diff --git a/review/pr-1877/.buildinfo b/review/pr-1877/.buildinfo new file mode 100644 index 00000000000..79f25f1111a --- /dev/null +++ b/review/pr-1877/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 1c48c8aab3261d0e85f85dec2f3f19c7 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/review/pr-1877/.doctrees/Introduction.doctree b/review/pr-1877/.doctrees/Introduction.doctree new file mode 100644 index 00000000000..f0c84f1fed1 Binary files /dev/null and b/review/pr-1877/.doctrees/Introduction.doctree differ diff --git a/review/pr-1877/.doctrees/api.doctree b/review/pr-1877/.doctrees/api.doctree new file mode 100644 index 00000000000..97cbd472fe7 Binary files /dev/null and b/review/pr-1877/.doctrees/api.doctree differ diff --git a/review/pr-1877/.doctrees/core_features.doctree b/review/pr-1877/.doctrees/core_features.doctree new file mode 100644 index 00000000000..3cae03062c5 Binary files /dev/null and b/review/pr-1877/.doctrees/core_features.doctree differ diff --git a/review/pr-1877/.doctrees/environment.pickle b/review/pr-1877/.doctrees/environment.pickle new file mode 100644 index 00000000000..bc38cbded2c Binary files /dev/null and b/review/pr-1877/.doctrees/environment.pickle differ diff --git a/review/pr-1877/.doctrees/examples/01-Getting-started.doctree b/review/pr-1877/.doctrees/examples/01-Getting-started.doctree new file mode 100644 index 00000000000..d810ec8c247 Binary files /dev/null and b/review/pr-1877/.doctrees/examples/01-Getting-started.doctree differ diff --git a/review/pr-1877/.doctrees/examples/02-Advanced-NVTabular-workflow.doctree b/review/pr-1877/.doctrees/examples/02-Advanced-NVTabular-workflow.doctree new file mode 100644 index 00000000000..617f4c10159 Binary files /dev/null and b/review/pr-1877/.doctrees/examples/02-Advanced-NVTabular-workflow.doctree differ diff --git a/review/pr-1877/.doctrees/examples/03-Running-on-multiple-GPUs-or-on-CPU.doctree b/review/pr-1877/.doctrees/examples/03-Running-on-multiple-GPUs-or-on-CPU.doctree new file mode 100644 index 00000000000..06b73ddb5a9 Binary files /dev/null and b/review/pr-1877/.doctrees/examples/03-Running-on-multiple-GPUs-or-on-CPU.doctree differ diff --git a/review/pr-1877/.doctrees/examples/index.doctree b/review/pr-1877/.doctrees/examples/index.doctree new file mode 100644 index 00000000000..e3ee14ffea7 Binary files /dev/null and b/review/pr-1877/.doctrees/examples/index.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.AddMetadata.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.AddMetadata.doctree new file mode 100644 index 00000000000..afaa73cc787 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.AddMetadata.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.AddProperties.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.AddProperties.doctree new file mode 100644 index 00000000000..a127b371f8c Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.AddProperties.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.AddTags.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.AddTags.doctree new file mode 100644 index 00000000000..6a1db43b1a6 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.AddTags.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Bucketize.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Bucketize.doctree new file mode 100644 index 00000000000..7dc73c02290 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Bucketize.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Categorify.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Categorify.doctree new file mode 100644 index 00000000000..36cd84bddce Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Categorify.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Clip.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Clip.doctree new file mode 100644 index 00000000000..12faf3157b6 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Clip.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.ColumnSimilarity.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.ColumnSimilarity.doctree new file mode 100644 index 00000000000..927979d03df Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.ColumnSimilarity.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.DifferenceLag.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.DifferenceLag.doctree new file mode 100644 index 00000000000..112e0cb00db Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.DifferenceLag.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.DropLowCardinality.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.DropLowCardinality.doctree new file mode 100644 index 00000000000..5efc7fa1ad3 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.DropLowCardinality.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Dropna.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Dropna.doctree new file mode 100644 index 00000000000..584daae9e4a Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Dropna.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.FillMedian.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.FillMedian.doctree new file mode 100644 index 00000000000..c3b239eef34 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.FillMedian.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.FillMissing.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.FillMissing.doctree new file mode 100644 index 00000000000..025bc0fdad3 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.FillMissing.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Filter.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Filter.doctree new file mode 100644 index 00000000000..facf174a7ff Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Filter.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Groupby.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Groupby.doctree new file mode 100644 index 00000000000..b536249acb8 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Groupby.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.HashBucket.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.HashBucket.doctree new file mode 100644 index 00000000000..b68ebe0a0ac Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.HashBucket.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.HashedCross.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.HashedCross.doctree new file mode 100644 index 00000000000..e48132e941d Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.HashedCross.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.JoinExternal.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.JoinExternal.doctree new file mode 100644 index 00000000000..5251538ff05 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.JoinExternal.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.JoinGroupby.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.JoinGroupby.doctree new file mode 100644 index 00000000000..8b348798e71 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.JoinGroupby.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.LambdaOp.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.LambdaOp.doctree new file mode 100644 index 00000000000..9d81dfcd676 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.LambdaOp.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.ListSlice.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.ListSlice.doctree new file mode 100644 index 00000000000..54702e64e6e Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.ListSlice.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.LogOp.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.LogOp.doctree new file mode 100644 index 00000000000..13ef5f477e7 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.LogOp.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Normalize.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Normalize.doctree new file mode 100644 index 00000000000..a89c0142b29 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Normalize.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.NormalizeMinMax.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.NormalizeMinMax.doctree new file mode 100644 index 00000000000..9cf9c8f11fb Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.NormalizeMinMax.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Operator.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Operator.doctree new file mode 100644 index 00000000000..e27434dae7f Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Operator.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.ReduceDtypeSize.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.ReduceDtypeSize.doctree new file mode 100644 index 00000000000..d29ec1b3554 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.ReduceDtypeSize.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.Rename.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.Rename.doctree new file mode 100644 index 00000000000..e994f83d90b Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.Rename.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.StatOperator.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.StatOperator.doctree new file mode 100644 index 00000000000..731a01b3001 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.StatOperator.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsItemFeatures.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsItemFeatures.doctree new file mode 100644 index 00000000000..73e9ae369b5 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsItemFeatures.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsItemID.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsItemID.doctree new file mode 100644 index 00000000000..7a5cf648267 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsItemID.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsUserFeatures.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsUserFeatures.doctree new file mode 100644 index 00000000000..d3bee8605d2 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsUserFeatures.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsUserID.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsUserID.doctree new file mode 100644 index 00000000000..cfea3b44542 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.TagAsUserID.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.TargetEncoding.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.TargetEncoding.doctree new file mode 100644 index 00000000000..04e42700ce8 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.TargetEncoding.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.ops.ValueCount.doctree b/review/pr-1877/.doctrees/generated/nvtabular.ops.ValueCount.doctree new file mode 100644 index 00000000000..bf3c6fa6fa4 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.ops.ValueCount.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.workflow.workflow.Workflow.doctree b/review/pr-1877/.doctrees/generated/nvtabular.workflow.workflow.Workflow.doctree new file mode 100644 index 00000000000..cf4b645f901 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.workflow.workflow.Workflow.doctree differ diff --git a/review/pr-1877/.doctrees/generated/nvtabular.workflow.workflow.WorkflowNode.doctree b/review/pr-1877/.doctrees/generated/nvtabular.workflow.workflow.WorkflowNode.doctree new file mode 100644 index 00000000000..0627470ee57 Binary files /dev/null and b/review/pr-1877/.doctrees/generated/nvtabular.workflow.workflow.WorkflowNode.doctree differ diff --git a/review/pr-1877/.doctrees/index.doctree b/review/pr-1877/.doctrees/index.doctree new file mode 100644 index 00000000000..4d595a38fcf Binary files /dev/null and b/review/pr-1877/.doctrees/index.doctree differ diff --git a/review/pr-1877/.doctrees/resources/architecture.doctree b/review/pr-1877/.doctrees/resources/architecture.doctree new file mode 100644 index 00000000000..46754c236d0 Binary files /dev/null and b/review/pr-1877/.doctrees/resources/architecture.doctree differ diff --git a/review/pr-1877/.doctrees/resources/cloud_integration.doctree b/review/pr-1877/.doctrees/resources/cloud_integration.doctree new file mode 100644 index 00000000000..ccc371900b5 Binary files /dev/null and b/review/pr-1877/.doctrees/resources/cloud_integration.doctree differ diff --git a/review/pr-1877/.doctrees/resources/index.doctree b/review/pr-1877/.doctrees/resources/index.doctree new file mode 100644 index 00000000000..2ee7c8109de Binary files /dev/null and b/review/pr-1877/.doctrees/resources/index.doctree differ diff --git a/review/pr-1877/.doctrees/resources/links.doctree b/review/pr-1877/.doctrees/resources/links.doctree new file mode 100644 index 00000000000..d008d46949b Binary files /dev/null and b/review/pr-1877/.doctrees/resources/links.doctree differ diff --git a/review/pr-1877/.doctrees/resources/troubleshooting.doctree b/review/pr-1877/.doctrees/resources/troubleshooting.doctree new file mode 100644 index 00000000000..9423a38d5b4 Binary files /dev/null and b/review/pr-1877/.doctrees/resources/troubleshooting.doctree differ diff --git a/review/pr-1877/.doctrees/training/hugectr.doctree b/review/pr-1877/.doctrees/training/hugectr.doctree new file mode 100644 index 00000000000..c7c1494e4f0 Binary files /dev/null and b/review/pr-1877/.doctrees/training/hugectr.doctree differ diff --git a/review/pr-1877/.doctrees/training/index.doctree b/review/pr-1877/.doctrees/training/index.doctree new file mode 100644 index 00000000000..c513368f862 Binary files /dev/null and b/review/pr-1877/.doctrees/training/index.doctree differ diff --git a/review/pr-1877/.doctrees/training/pytorch.doctree b/review/pr-1877/.doctrees/training/pytorch.doctree new file mode 100644 index 00000000000..48ff4fb73a3 Binary files /dev/null and b/review/pr-1877/.doctrees/training/pytorch.doctree differ diff --git a/review/pr-1877/.doctrees/training/tensorflow.doctree b/review/pr-1877/.doctrees/training/tensorflow.doctree new file mode 100644 index 00000000000..02045cfa6f4 Binary files /dev/null and b/review/pr-1877/.doctrees/training/tensorflow.doctree differ diff --git a/review/pr-1877/.nojekyll b/review/pr-1877/.nojekyll new file mode 100644 index 00000000000..e69de29bb2d diff --git a/review/pr-1877/Introduction.html b/review/pr-1877/Introduction.html new file mode 100644 index 00000000000..0980ba068b1 --- /dev/null +++ b/review/pr-1877/Introduction.html @@ -0,0 +1,655 @@ + + + + + + + + + + + + NVTabular — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + +
+ +
+

NVTabular#

+

PyPI +LICENSE +Documentation

+

NVTabular is a feature engineering and preprocessing library for tabular data that is designed to easily manipulate terabyte scale datasets and train deep learning (DL) based recommender systems. It provides high-level abstraction to simplify code and accelerates computation on the GPU using the RAPIDS Dask-cuDF library.

+

NVTabular is a component of NVIDIA Merlin, an open source framework for building and deploying recommender systems and works with the other Merlin components including Merlin Models, HugeCTR and Merlin Systems to provide end-to-end acceleration of recommender systems on the GPU. Extending beyond model training, with NVIDIA’s Triton Inference Server, the feature engineering and preprocessing steps performed on the data during training can be automatically applied to incoming data during inference.

+ +
+

Benefits#

+

When training DL recommender systems, data scientists and machine learning (ML) engineers have been faced with the following challenges:

+
    +
  • Huge Datasets: Commercial recommenders are trained on huge datasets that may be several terabytes in scale.

  • +
  • Complex Data Feature Engineering and Preprocessing Pipelines: Datasets need to be preprocessed and transformed so that they can be used with DL models and frameworks. In addition, feature engineering creates an extensive set of new features from existing ones, requiring multiple iterations to arrive at an optimal solution.

  • +
  • Input Bottleneck: Data loading, if not well optimized, can be the slowest part of the training process, leading to under-utilization of high-throughput computing devices such as GPUs.

  • +
  • Extensive Repeated Experimentation: The entire data engineering, training, and evaluation process can be repetitious and time consuming, requiring significant computational resources.

  • +
+

NVTabular alleviates these challenges and helps data scientists and ML engineers:

+
    +
  • process datasets that exceed GPU and CPU memory without having to worry about scale.

  • +
  • focus on what to do with the data and not how to do it by using abstraction at the operation level.

  • +
  • prepare datasets quickly and easily for experimentation so that more models can be trained.

  • +
  • deploy models into production by providing faster dataset transformation

  • +
+

Learn more in the NVTabular core features documentation.

+
+
+

Performance#

+

When running NVTabular on the Criteo 1TB Click Logs Dataset using a single V100 32GB GPU, feature engineering and preprocessing was able to be completed in 13 minutes. Furthermore, when running NVTabular on a DGX-1 cluster with eight V100 GPUs, feature engineering and preprocessing was able to be completed within three minutes. Combined with HugeCTR, the dataset can be processed and a full model can be trained in only six minutes.

+

The performance of the Criteo DRLM workflow also demonstrates the effectiveness of the NVTabular library. The original ETL script provided in Numpy took over five days to complete. Combined with CPU training, the total iteration time is over one week. By optimizing the ETL code in Spark and running on a DGX-1 equivalent cluster, the time to complete feature engineering and preprocessing was reduced to three hours. Meanwhile, training was completed in one hour.

+
+
+

Installation#

+

NVTabular requires Python version 3.7+. Additionally, GPU support requires:

+
    +
  • CUDA version 11.0+

  • +
  • NVIDIA Pascal GPU or later (Compute Capability >=6.0)

  • +
  • NVIDIA driver 450.80.02+

  • +
  • Linux or WSL

  • +
+
+

Installing NVTabular Using Conda#

+

NVTabular can be installed with Anaconda from the nvidia channel by running the following command:

+
conda install -c nvidia -c rapidsai -c numba -c conda-forge nvtabular python=3.7 cudatoolkit=11.2
+
+
+
+
+

Installing NVTabular Using Pip#

+

NVTabular can be installed with pip by running the following command:

+
pip install nvtabular
+
+
+
+

Installing NVTabular with Pip causes NVTabular to run on the CPU only and might require installing additional dependencies manually. +When you run NVTabular in one of our Docker containers, the dependencies are already installed.

+
+
+
+

Installing NVTabular with Docker#

+

NVTabular Docker containers are available in the NVIDIA Merlin container +repository. +The following table summarizes the key information about the containers:

+ + + + + + + + + + + + + + + + + + + + + +

Container Name

Container Location

Functionality

merlin-hugectr

https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-hugectr

NVTabular, HugeCTR, and Triton Inference

merlin-tensorflow

https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow

NVTabular, Tensorflow and Triton Inference

merlin-pytorch

https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-pytorch

NVTabular, PyTorch, and Triton Inference

+

To use these Docker containers, you’ll first need to install the NVIDIA Container Toolkit to provide GPU support for Docker. You can use the NGC links referenced in the table above to obtain more information about how to launch and run these containers. To obtain more information about the software and model versions that NVTabular supports per container, see Support Matrix.

+
+
+
+

Notebook Examples and Tutorials#

+

We provide a collection of examples to demonstrate feature engineering with NVTabular as Jupyter notebooks:

+
    +
  • Introduction to NVTabular’s High-Level API

  • +
  • Advanced workflows with NVTabular

  • +
  • NVTabular on CPU

  • +
  • Scaling NVTabular to multi-GPU systems

  • +
+

In addition, NVTabular is used in many of our examples in other Merlin libraries:

+ +
+
+

Feedback and Support#

+

If you’d like to contribute to the library directly, see the Contributing.md. We’re particularly interested in contributions or feature requests for our feature engineering and preprocessing operations. To further advance our Merlin Roadmap, we encourage you to share all the details regarding your recommender system pipeline in this survey.

+

If you’re interested in learning more about how NVTabular works, see +our NVTabular documentation. We also have API documentation that outlines the specifics of the available calls within the library.

+
+
+ + +
+ + + + + + + + +
+ + + + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_images/645e1a2cc9f5a764d5147f7e3bf7db26f4c65e95032e0239fcf969bf90c12694.svg b/review/pr-1877/_images/645e1a2cc9f5a764d5147f7e3bf7db26f4c65e95032e0239fcf969bf90c12694.svg new file mode 100644 index 00000000000..d2a09b27ba7 --- /dev/null +++ b/review/pr-1877/_images/645e1a2cc9f5a764d5147f7e3bf7db26f4c65e95032e0239fcf969bf90c12694.svg @@ -0,0 +1,55 @@ + + + + + + +%3 + + + +0 + +Categorify + + + +2 + +output cols + + + +0->2 + + + + + +1 + +SelectionOp + + + +1->0 + + + + + +1_selector + +['userId', 'movieId'] + + + +1_selector->1 + + + + + \ No newline at end of file diff --git a/review/pr-1877/_images/dask-dataframe.svg b/review/pr-1877/_images/dask-dataframe.svg new file mode 100644 index 00000000000..7d371234328 --- /dev/null +++ b/review/pr-1877/_images/dask-dataframe.svg @@ -0,0 +1,225 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + January, 2016 + Febrary, 2016 + March, 2016 + April, 2016 + May, 2016 + Pandas DataFrame + } + Dask DataFrame + } + + diff --git a/review/pr-1877/_images/nvt_databricks.png b/review/pr-1877/_images/nvt_databricks.png new file mode 100644 index 00000000000..bbf993c6b57 Binary files /dev/null and b/review/pr-1877/_images/nvt_databricks.png differ diff --git a/review/pr-1877/_images/nvt_workflow_graph.png b/review/pr-1877/_images/nvt_workflow_graph.png new file mode 100644 index 00000000000..f5a4557a894 Binary files /dev/null and b/review/pr-1877/_images/nvt_workflow_graph.png differ diff --git a/review/pr-1877/_modules/index.html b/review/pr-1877/_modules/index.html new file mode 100644 index 00000000000..456ed131b45 --- /dev/null +++ b/review/pr-1877/_modules/index.html @@ -0,0 +1,459 @@ + + + + + + + + + + + Overview: module code — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

All modules for which code is available

+ + +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/merlin/dag/operator.html b/review/pr-1877/_modules/merlin/dag/operator.html new file mode 100644 index 00000000000..713dcb0f6e2 --- /dev/null +++ b/review/pr-1877/_modules/merlin/dag/operator.html @@ -0,0 +1,884 @@ + + + + + + + + + + + merlin.dag.operator — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for merlin.dag.operator

+#
+# Copyright (c) 2022, NVIDIA CORPORATION.
+#
+# 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.
+#
+from __future__ import annotations
+
+import os
+from enum import Flag, auto
+from typing import Any, List, Optional, Union
+
+import merlin.dag
+import merlin.dag.utils
+from merlin.core.protocols import Transformable
+from merlin.dag.selector import ColumnSelector
+from merlin.schema import ColumnSchema, Schema
+
+
+class Supports(Flag):
+    """
+    Indicates what type of data representation this operator supports for transformations
+
+    (Deprecated)
+    """
+
+    # cudf dataframe
+    CPU_DATAFRAME = auto()
+    # pandas dataframe
+    GPU_DATAFRAME = auto()
+    # dict of column name to numpy array
+    CPU_DICT_ARRAY = auto()
+    # dict of column name to cupy array
+    GPU_DICT_ARRAY = auto()
+
+
+class DataFormats(Flag):
+    CUDF_DATAFRAME = auto()
+    PANDAS_DATAFRAME = auto()
+
+    NUMPY_TENSOR_TABLE = auto()
+    CUPY_TENSOR_TABLE = auto()
+    TF_TENSOR_TABLE = auto()
+    TORCH_TENSOR_TABLE = auto()
+
+    NUMPY_DICT_ARRAY = auto()
+    CUPY_DICT_ARRAY = auto()
+
+
+# pylint: disable=too-many-public-methods
+
[docs]class Operator: + """ + Base class for all operator classes. + """ + +
[docs] def compute_selector( + self, + input_schema: Schema, + selector: ColumnSelector, + parents_selector: Optional[ColumnSelector] = None, + dependencies_selector: Optional[ColumnSelector] = None, + ) -> ColumnSelector: + """ + Provides a hook method for sub-classes to override to implement + custom column selection logic. + + Parameters + ---------- + input_schema : Schema + Schemas of the columns to apply this operator to + selector : ColumnSelector + Column selector to apply to the input schema + parents_selector : ColumnSelector + Combined selectors of the upstream parents feeding into this operator + dependencies_selector : ColumnSelector + Combined selectors of the upstream dependencies feeding into this operator + + Returns + ------- + ColumnSelector + Revised column selector to apply to the input schema + """ + selector = selector or ColumnSelector("*") + + self._validate_matching_cols(input_schema, selector, self.compute_selector.__name__) + + return selector.resolve(input_schema)
+ +
[docs] def compute_input_schema( + self, + root_schema: Schema, + parents_schema: Schema, + deps_schema: Schema, + selector: ColumnSelector, + ) -> Schema: + """Given the schemas coming from upstream sources and a column selector for the + input columns, returns a set of schemas for the input columns this operator will use + + Parameters + ----------- + root_schema: Schema + Base schema of the dataset before running any operators. + parents_schema: Schema + The combined schemas of the upstream parents feeding into this operator + deps_schema: Schema + The combined schemas of the upstream dependencies feeding into this operator + col_selector: ColumnSelector + The column selector to apply to the input schema + + Returns + ------- + Schema + The schemas of the columns used by this operator + """ + self._validate_matching_cols( + parents_schema + deps_schema, selector, self.compute_input_schema.__name__ + ) + + return parents_schema + deps_schema
+ +
[docs] def compute_output_schema( + self, + input_schema: Schema, + col_selector: ColumnSelector, + prev_output_schema: Optional[Schema] = None, + ) -> Schema: + """ + Given a set of schemas and a column selector for the input columns, + returns a set of schemas for the transformed columns this operator will produce + + Parameters + ----------- + input_schema: Schema + The schemas of the columns to apply this operator to + col_selector: ColumnSelector + The column selector to apply to the input schema + + Returns + ------- + Schema + The schemas of the columns produced by this operator + """ + if not col_selector: + col_selector = ColumnSelector(input_schema.column_names) + + if col_selector.tags: + tags_col_selector = ColumnSelector(tags=col_selector.tags) + filtered_schema = input_schema.apply(tags_col_selector) + col_selector += ColumnSelector(filtered_schema.column_names) + + # zero tags because already filtered + col_selector._tags = [] + + self._validate_matching_cols( + input_schema, col_selector, self.compute_output_schema.__name__ + ) + + output_schema = Schema() + for output_col_name, input_col_names in self.column_mapping(col_selector).items(): + input_schema_fragment = input_schema[input_col_names] + col_schema = self.compute_column_schema(output_col_name, input_schema_fragment) + output_schema += Schema([col_schema]) + + if self.dynamic_dtypes and prev_output_schema: + for col_name, col_schema in output_schema.column_schemas.items(): + dtype = prev_output_schema[col_name].dtype + output_schema.column_schemas[col_name] = col_schema.with_dtype(dtype) + + return output_schema
+ +
[docs] def validate_schemas( + self, + parents_schema: Schema, + deps_schema: Schema, + input_schema: Schema, + output_schema: Schema, + strict_dtypes: bool = False, + ): + """ + Provides a hook method that sub-classes can override to implement schema validation logic. + + Sub-class implementations should raise an exception if the schemas are not valid for the + operations they implement. + + Parameters + ---------- + parents_schema : Schema + The combined schemas of the upstream parents feeding into this operator + deps_schema : Schema + The combined schemas of the upstream dependencies feeding into this operator + input_schema : Schema + The schemas of the columns to apply this operator to + output_schema : Schema + The schemas of the columns produced by this operator + strict_dtypes : Boolean, optional + Enables strict checking for column dtype matching if True, by default False + """
+ +
[docs] def transform( + self, col_selector: ColumnSelector, transformable: Transformable + ) -> Transformable: + """Transform the dataframe by applying this operator to the set of input columns + + Parameters + ----------- + col_selector: ColumnSelector + The columns to apply this operator to + transformable: Transformable + A pandas or cudf dataframe that this operator will work on + + Returns + ------- + Transformable + Returns a transformed dataframe or dictarray for this operator + """ + return transformable
+ +
[docs] def column_mapping(self, col_selector): + """ + Compute which output columns depend on which input columns + + Parameters + ---------- + col_selector : ColumnSelector + A selector containing a list of column names + + Returns + ------- + Dict[str, List[str]] + Mapping from output column names to list of the input columns they rely on + """ + column_mapping = {} + for col_name in col_selector.names: + column_mapping[col_name] = [col_name] + return column_mapping
+ +
[docs] def load_artifacts(self, artifact_path: Optional[os.PathLike] = None): + """Load artifacts from disk required for operator function. + + Parameters + ---------- + artifact_path : str + The path where artifacts are loaded from + """
+ +
[docs] def save_artifacts(self, artifact_path: Optional[os.PathLike] = None) -> None: + """Save artifacts required to be reload operator state from disk + + Parameters + ---------- + artifact_path : str + The path where artifacts are to be saved + """
+ +
[docs] def compute_column_schema(self, col_name, input_schema): + methods = [ + self._compute_dtype, + self._compute_tags, + self._compute_properties, + self._compute_shape, + ] + return self._compute_column_schema(col_name, input_schema, methods=methods)
+ + def _compute_column_schema(self, col_name, input_schema, methods=None): + col_schema = ColumnSchema(col_name) + + for method in methods: + col_schema = method(col_schema, input_schema) + + return col_schema + + def _compute_dtype(self, col_schema, input_schema): + dtype = col_schema.dtype + + if input_schema.column_schemas: + source_col_name = input_schema.column_names[0] + dtype = input_schema[source_col_name].dtype + + if self.output_dtype is not None: + dtype = self.output_dtype + + return col_schema.with_dtype(dtype) + + def _compute_shape(self, col_schema, input_schema): + shape = col_schema.shape + + if input_schema.column_schemas: + source_col_name = input_schema.column_names[0] + shape = input_schema[source_col_name].shape + + return col_schema.with_shape(shape) + + @property + def dynamic_dtypes(self): + return False + + @property + def is_subgraph(self): + return False + + def _compute_tags(self, col_schema, input_schema): + tags = [] + if input_schema.column_schemas: + source_col_name = input_schema.column_names[0] + tags = input_schema[source_col_name].tags + + # Override empty tags with tags from the input schema + # Override input schema tags with the output tags of this operator + return col_schema.with_tags(tags).with_tags(self.output_tags) + + def _compute_properties(self, col_schema, input_schema): + properties = {} + + if input_schema.column_schemas: + source_col_name = input_schema.column_names[0] + properties.update(input_schema.column_schemas[source_col_name].properties) + + properties.update(self.output_properties) + + return col_schema.with_properties(properties) + + def _validate_matching_cols(self, schema, selector, method_name): + selector = selector or ColumnSelector() + resolved_selector = selector.resolve(schema) + + missing_cols = [name for name in selector.names if name not in resolved_selector.names] + if missing_cols: + raise ValueError( + f"Missing columns {missing_cols} found in operator" + f"{self.__class__.__name__} during {method_name}." + ) + + # TODO: Update instructions for how to define custom + # operators to reflect constructing the column mapping + # (They should no longer override this method) +
[docs] def output_column_names(self, col_selector: ColumnSelector) -> ColumnSelector: + """Given a set of columns names returns the names of the transformed columns this + operator will produce + + Parameters + ----------- + columns: list of str, or list of list of str + The columns to apply this operator to + + Returns + ------- + list of str, or list of list of str + The names of columns produced by this operator + """ + return ColumnSelector(list(self.column_mapping(col_selector).keys()))
+ + @property + def dependencies(self) -> List[Union[str, Any]]: + """Defines an optional list of column dependencies for this operator. + This lets you consume columns that aren't part of the main transformation workflow. + + Returns + ------- + str, list of str or ColumnSelector, optional + Extra dependencies of this operator. Defaults to None + """ + return [] + + def __rrshift__(self, other): + return ColumnSelector(other) >> self + + @property + def output_dtype(self): + return None + + @property + def output_tags(self): + return [] + + @property + def output_properties(self): + return {} + + @property + def label(self) -> str: + return self.__class__.__name__ + +
[docs] def create_node(self, selector): + return merlin.dag.Node(selector)
+ + @property + def supports(self) -> Supports: + """Returns what kind of data representation this operator supports""" + return Supports.CPU_DATAFRAME | Supports.GPU_DATAFRAME + + @property + def supported_formats(self) -> DataFormats: + return ( + DataFormats.PANDAS_DATAFRAME + | DataFormats.CUDF_DATAFRAME + | DataFormats.NUMPY_TENSOR_TABLE + | DataFormats.CUPY_TENSOR_TABLE + ) + + def _get_columns(self, df, selector): + if isinstance(df, dict): + return {col_name: df[col_name] for col_name in selector.names} + else: + return df[selector.names] + + @property + def export_name(self): + """ + Provides a clear common english identifier for this operator. + + Returns + ------- + String + Name of the current class as spelled in module. + """ + return self.__class__.__name__.lower() + +
[docs] def export(self, path: str, input_schema: Schema, output_schema: Schema, **kwargs): + """ + Export the class object as a config and all related files to the user defined path. + + Parameters + ---------- + path : str + Artifact export path + input_schema : Schema + A schema with information about the inputs to this operator. + output_schema : Schema + A schema with information about the outputs of this operator. + params : dict, optional + Parameters dictionary of key, value pairs stored in exported config, by default None. + node_id : int, optional + The placement of the node in the graph (starts at 1), by default None. + version : int, optional + The version of the operator, by default 1. + + Returns + ------- + model_config: dict + The config for the exported operator. + """
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/merlin/dag/ops/stat_operator.html b/review/pr-1877/_modules/merlin/dag/ops/stat_operator.html new file mode 100644 index 00000000000..5036dc4a435 --- /dev/null +++ b/review/pr-1877/_modules/merlin/dag/ops/stat_operator.html @@ -0,0 +1,492 @@ + + + + + + + + + + + merlin.dag.ops.stat_operator — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for merlin.dag.ops.stat_operator

+#
+# Copyright (c) 2023, NVIDIA CORPORATION.
+#
+# 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.
+#
+from typing import Any
+
+import dask.dataframe as dd
+
+from merlin.dag.operator import Operator
+from merlin.dag.selector import ColumnSelector
+
+
+
[docs]class StatOperator(Operator): + """ + Base class for statistical operator classes. This adds a 'fit' and 'finalize' method + on top of the Operator class. + """ + + fitted = False + +
[docs] def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame) -> Any: + """Calculate statistics for this operator, and return a dask future + to these statistics, which will be computed by the workflow.""" + + raise NotImplementedError( + """The dask operations needed to return a dictionary of uncomputed statistics.""" + )
+ +
[docs] def fit_finalize(self, dask_stats): + """Finalize statistics calculation - the workflow calls this function with + the computed statistics from the 'fit' object'""" + + raise NotImplementedError( + """Follow-up operations to convert dask statistics in to member variables""" + )
+ +
[docs] def clear(self): + """zero and reinitialize all relevant statistical properties""" + raise NotImplementedError("clear isn't implemented for this op!")
+ +
[docs] def set_storage_path(self, new_path, copy=False): + """Certain stat operators need external storage - for instance Categorify writes out + parquet files containing the categorical mapping. When we save the operator, we + also want to save these files as part of the bundle. Implementing this method + lets statoperators bundle their dependent files into the new path that we're writing + out (note that this could happen after the operator is created) + """
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/add_metadata.html b/review/pr-1877/_modules/nvtabular/ops/add_metadata.html new file mode 100644 index 00000000000..67e8506a700 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/add_metadata.html @@ -0,0 +1,506 @@ + + + + + + + + + + + nvtabular.ops.add_metadata — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.add_metadata

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+from merlin.core.dispatch import DataFrameType
+from merlin.schema.tags import Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class AddMetadata(Operator): + """ + This operator will add user defined tags and properties + to a Schema. + """ + +
[docs] def __init__(self, tags=None, properties=None): + super().__init__() + self.tags = tags or [] + self.properties = properties or {}
+ +
[docs] def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + return df
+ + @property + def output_tags(self): + return self.tags + + @property + def output_properties(self): + return self.properties
+ + +
[docs]class AddTags(AddMetadata): +
[docs] def __init__(self, tags=None): + super().__init__(tags=tags)
+ + +
[docs]class AddProperties(AddMetadata): +
[docs] def __init__(self, properties=None): + super().__init__(properties=properties)
+ + +# Wrappers for common features +
[docs]class TagAsUserID(AddTags): +
[docs] def __init__(self, tags=None): + super().__init__(tags=[Tags.ID, Tags.USER])
+ + +
[docs]class TagAsItemID(AddTags): +
[docs] def __init__(self, tags=None): + super().__init__(tags=[Tags.ID, Tags.ITEM])
+ + +
[docs]class TagAsUserFeatures(AddTags): +
[docs] def __init__(self, tags=None): + super().__init__(tags=[Tags.USER])
+ + +
[docs]class TagAsItemFeatures(AddTags): +
[docs] def __init__(self, tags=None): + super().__init__(tags=[Tags.ITEM])
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/bucketize.html b/review/pr-1877/_modules/nvtabular/ops/bucketize.html new file mode 100644 index 00000000000..cae2c9a941b --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/bucketize.html @@ -0,0 +1,531 @@ + + + + + + + + + + + nvtabular.ops.bucketize — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.bucketize

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+
+import numpy as np
+from packaging.version import Version
+
+from merlin.core.dispatch import DataFrameType, annotate, array
+from merlin.schema import Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class Bucketize(Operator): + """This operation transforms continuous features into categorical features + with bins based on the provided bin boundaries. + + Example usage:: + + # + cont_names = ['cont1', 'cont2'] + boundaries = { + 'cont1': [-50, 0, 50], + 'cont2': [0, 25, 50, 75, 100] + } + bucketize_op = cont_names >> ops.Bucketize(boundaries) + processor = nvt.Workflow(bucketize_op) + + Parameters + ---------- + boundaries : int, dict or callable + Defines how to transform the continuous values into bins + """ + +
[docs] def __init__(self, boundaries): + # Check if we have cupy.digitize support + try: + import cupy + + self.use_digitize = Version(cupy.__version__) >= Version("8.0.0") + except ImportError: + # Assume cpu-backed data (since cupy is not even installed) + self.use_digitize = True + + # transform boundaries into a lookup function on column names + if isinstance(boundaries, (list, tuple)): + self.boundaries = lambda col: boundaries + elif isinstance(boundaries, dict): + self.boundaries = lambda col: boundaries[col] + elif callable(boundaries): + self.boundaries = boundaries + else: + raise TypeError( + "`boundaries` must be dict, callable, or list, got type {}".format(type(boundaries)) + ) + super().__init__()
+ +
[docs] @annotate("Bucketize_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + boundaries = {name: self.boundaries(name) for name in col_selector.names} + new_df = type(df)() + for col, b in boundaries.items(): + if self.use_digitize: + new_df[col] = np.digitize( + df[col].values, + array(b, like_df=df), + right=False, + ) + else: + # TODO: Remove use_digitize=False code path + # once cupy>=8.0.0 is required. + val = 0 + for boundary in b: + val += df[col] >= boundary + new_df[col] = val + new_df[col] = new_df[col].astype(self.output_dtype) + return new_df
+ + @property + def output_tags(self): + return [Tags.CATEGORICAL] + + @property + def output_dtype(self): + return np.int32 + + transform.__doc__ = Operator.transform.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/categorify.html b/review/pr-1877/_modules/nvtabular/ops/categorify.html new file mode 100644 index 00000000000..4c985432004 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/categorify.html @@ -0,0 +1,2350 @@ + + + + + + + + + + + nvtabular.ops.categorify — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.categorify

+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+
+import math
+import os
+import warnings
+from collections import defaultdict
+from copy import deepcopy
+from dataclasses import dataclass
+from operator import getitem
+from pathlib import Path
+from typing import Optional, Union
+
+import dask.dataframe as dd
+import numpy as np
+import pandas as pd
+import pyarrow as pa
+import pyarrow.dataset as pa_ds
+from dask import config
+from dask.base import tokenize
+from dask.blockwise import BlockIndex
+from dask.core import flatten
+from dask.dataframe.core import DataFrame as DaskDataFrame
+from dask.dataframe.core import _concat, new_dd_object
+from dask.dataframe.shuffle import shuffle_group
+from dask.delayed import Delayed
+from dask.highlevelgraph import HighLevelGraph
+from dask.utils import parse_bytes
+from fsspec.core import get_fs_token_paths
+
+from merlin.core import dispatch
+from merlin.core.dispatch import DataFrameType, annotate, is_cpu_object, nullable_series
+from merlin.core.utils import device_mem_size, run_on_worker
+from merlin.dag.ops.stat_operator import StatOperator
+from merlin.io.worker import fetch_table_data, get_worker_cache
+from merlin.schema import Schema, Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+# Constants
+# (NVTabular will reserve `0` for padding and `1` for nulls)
+PAD_OFFSET = 0
+NULL_OFFSET = 1
+OOV_OFFSET = 2
+
+
+
[docs]class Categorify(StatOperator): + """ + Most of the data set will contain categorical features, + and these variables are typically stored as text values. + Machine Learning algorithms don't support these text values. + Categorify operation can be added to the workflow to + transform categorical features into unique integer values. + + Encoding Convention:: + + - `0`: Not used by `Categorify` (reserved for padding). + - `1`: Null and NaN values. + - `[2, 2 + num_buckets)`: OOV values (including hash buckets). + - `[2 + num_buckets, max_size)`: Unique vocabulary. + + Example usage:: + + # Define pipeline + cat_features = CATEGORICAL_COLUMNS >> nvt.ops.Categorify(freq_threshold=10) + + # Initialize the workflow and execute it + proc = nvt.Workflow(cat_features) + proc.fit(dataset) + proc.transform(dataset).to_parquet('./test/') + + Example for frequency hashing:: + + import cudf + import nvtabular as nvt + + # Create toy dataset + df = cudf.DataFrame({ + 'author': ['User_A', 'User_B', 'User_C', 'User_C', 'User_A', 'User_B', 'User_A'], + 'productID': [100, 101, 102, 101, 102, 103, 103], + 'label': [0, 0, 1, 1, 1, 0, 0] + }) + dataset = nvt.Dataset(df) + + # Define pipeline + CATEGORICAL_COLUMNS = ['author', 'productID'] + cat_features = CATEGORICAL_COLUMNS >> nvt.ops.Categorify( + freq_threshold={"author": 3, "productID": 2}, + num_buckets={"author": 10, "productID": 20}) + + + # Initialize the workflow and execute it + proc = nvt.Workflow(cat_features) + proc.fit(dataset) + ddf = proc.transform(dataset).to_ddf() + + # Print results + print(ddf.compute()) + + Example with multi-hot:: + + import cudf + import nvtabular as nvt + + # Create toy dataset + df = cudf.DataFrame({ + 'userID': [10001, 10002, 10003], + 'productID': [30003, 30005, 40005], + 'categories': [['Cat A', 'Cat B'], ['Cat C'], ['Cat A', 'Cat C', 'Cat D']], + 'label': [0,0,1] + }) + dataset = nvt.Dataset(df) + + # Define pipeline + CATEGORICAL_COLUMNS = ['userID', 'productID', 'categories'] + cat_features = CATEGORICAL_COLUMNS >> nvt.ops.Categorify() + + # Initialize the workflow and execute it + proc = nvt.Workflow(cat_features) + proc.fit(dataset) + ddf = proc.transform(dataset).to_ddf() + + # Print results + print(ddf.compute()) + + Parameters + ----------- + freq_threshold : int or dictionary:{column: freq_limit_value}, default 0 + Categories with a count/frequency below this threshold will be + omitted from the encoding and corresponding data will be mapped + to the OOV indices. Can be represented as both an integer or + a dictionary with column names as keys and frequency limit as + value. If dictionary is used, all columns targeted must be included + in the dictionary. + encode_type : {"joint", "combo"}, default "joint" + If "joint", the columns within any multi-column group will be + jointly encoded. If "combo", the combination of values will be + encoded as a new column. Note that replacement is not allowed for + "combo", because the same column name can be included in + multiple groups. + split_out : dict or int, optional + Number of files needed to store the unique values of each categorical + column. High-cardinality columns may require `split_out>1`, while + low-cardinality columns should be fine with the `split_out=1` default. + If passing a dict, each key and value should correspond to the column + name and value, respectively. The default value is 1 for all columns. + split_every : dict or int, optional + Number of adjacent partitions to aggregate in each tree-reduction + node. The default value is 8 for all columns. + out_path : str, optional + Root directory where groupby statistics will be written out in + parquet format. + on_host : bool, default True + Whether to convert cudf data to pandas between tasks in the hash-based + groupby reduction. The extra host <-> device data movement can reduce + performance. However, using `on_host=True` typically improves stability + (by avoiding device-level memory pressure). + cat_cache : {"device", "host", "disk"} or dict + Location to cache the list of unique categories for + each categorical column. If passing a dict, each key and value + should correspond to the column name and location, respectively. + Default is "host" for all columns. + dtype : + If specified, categorical labels will be cast to this dtype + after encoding is performed. + name_sep : str, default "_" + String separator to use between concatenated column names + for multi-column groups. + search_sorted : bool, default False. + Set it True to apply searchsorted algorithm in encoding. + num_buckets : int, or dictionary:{column: num_oov_indices}, optional + Number of indices to reserve for out-of-vocabulary (OOV) encoding at + transformation time. By default, all OOV values will be mapped to + the same index (`2`). If `num_buckets` is set to an integer greater + than one, a column-wise hash and modulo will be used to map each OOV + value to an index in the range `[2, 2 + num_buckets)`. A dictionary + may be used if the desired `num_buckets` behavior varies by column. + max_size : int or dictionary:{column: max_size_value}, optional + Set the maximum size of the expected embedding table for each column. + For example, if `max_size` is set to 1000, only the first 997 most- + frequent values will be included in the unique-value vocabulary, and + all remaining non-null values will be mapped to the OOV indices + (indices `0` and `1` will still be reserved for padding and nulls). + To use multiple OOV indices for infrequent values, set the `num_buckets` + parameter accordingly. Note that `max_size` cannot be combined with + `freq_threshold`, and it cannot be less than `num_buckets + 2`. By + default, the total number of encoding indices will be unconstrained. + cardinality_memory_limit: int or str, optional + Upper limit on the "allowed" memory usage of the internal DataFrame and Table objects + used to store unique categories. By default, this limit is 12.5% of the total memory. + Note that this argument is meant as a guide for internal optimizations and UserWarnings + within NVTabular, and does not guarantee that the memory limit will be satisfied. + """ + +
[docs] def __init__( + self, + freq_threshold=0, + out_path=None, + cat_cache="host", + dtype=None, + on_host=True, + encode_type="joint", + name_sep="_", + search_sorted=False, + num_buckets=None, + vocabs=None, + max_size=0, + single_table=False, + cardinality_memory_limit=None, + tree_width=None, + split_out=1, + split_every=8, + **kwargs, # Deprecated/unsupported arguments + ): + # Handle deprecations and unsupported kwargs + if "start_index" in kwargs: + raise ValueError( + "start_index is now deprecated. `Categorify` will always " + "reserve index `0` for user-specific purposes, and will " + "use index `1` for null values." + ) + if "na_sentinel" in kwargs: + raise ValueError( + "na_sentinel is now deprecated. `Categorify` will always " + "reserve index `1` for null values, and the following " + "`num_buckets` indices for out-of-vocabulary values " + "(or just index `2` if `num_buckets is None`)." + ) + if kwargs: + raise ValueError(f"Unrecognized key-word arguments: {kwargs}") + + # Warn user if they set num_buckets without setting max_size or + # freq_threshold - This setting used to hash everything, but will + # now just use multiple indices for OOV encodings at transform time + if num_buckets and not (max_size or freq_threshold): + warnings.warn( + "You are setting num_buckets without using max_size or " + "freq_threshold to restrict the number of distinct " + "categories. Are you sure this is what you want?" + ) + + # We need to handle three types of encoding here: + # + # (1) Conventional encoding. There are no multi-column groups. So, + # each categorical column is separately transformed into a new + # "encoded" column (1-to-1). The unique values are calculated + # separately for each column. + # + # (2) Multi-column "Joint" encoding (there are multi-column groups + # in `columns` and `encode_type="joint"`). Still a + # 1-to-1 transformation of categorical columns. However, + # we concatenate column groups to determine uniques (rather + # than getting uniques of each categorical column separately). + # + # (3) Multi-column "Group" encoding (there are multi-column groups + # in `columns` and `encode_type="combo"`). No longer + # a 1-to-1 transformation of categorical columns. Each column + # group will be transformed to a single "encoded" column. This + # means the unique "values" correspond to unique combinations. + # Since the same column may be included in multiple groups, + # replacement is not allowed for this transform. + + # Set workflow_nodes if the user has passed in a list of columns. + # The purpose is to capture multi-column groups. If the user doesn't + # specify `columns`, there are no multi-column groups to worry about. + self.workflow_nodes = None + self.name_sep = name_sep + + # For case (2), we need to keep track of the multi-column group name + # that will be used for the joint encoding of each column in that group. + # For case (3), we also use this "storage name" to signify the name of + # the file with the required "combination" groupby statistics. + self.storage_name = {} + + # Only support two kinds of multi-column encoding + if encode_type not in ("joint", "combo"): + raise ValueError(f"encode_type={encode_type} not supported.") + if encode_type == "combo" and vocabs is not None: + raise ValueError("Passing in vocabs is not supported with a combo encoding.") + + # Other self-explanatory initialization + super().__init__() + self.single_table = single_table + self.freq_threshold = freq_threshold or 0 + self.out_path = out_path or "./" + self.dtype = dtype + self.on_host = on_host + self.cat_cache = cat_cache + self.encode_type = encode_type + self.search_sorted = search_sorted + self.cardinality_memory_limit = cardinality_memory_limit + self.split_every = split_every + self.split_out = split_out + _deprecate_tree_width(tree_width) + + if self.search_sorted and self.freq_threshold: + raise ValueError( + "cannot use search_sorted=True with anything else than the default freq_threshold" + ) + if num_buckets == 0: + raise ValueError( + "For hashing num_buckets should be an int > 1, otherwise set num_buckets=None." + ) + elif isinstance(num_buckets, dict): + self.num_buckets = num_buckets + elif isinstance(num_buckets, int) or num_buckets is None: + self.num_buckets = num_buckets + else: + raise ValueError( + "`num_buckets` must be dict or int, got type {}".format(type(num_buckets)) + ) + if isinstance(max_size, dict): + self.max_size = max_size + elif isinstance(max_size, int) or max_size is None: + self.max_size = max_size + else: + raise ValueError("max_size must be dict or int, got type {}".format(type(max_size))) + if freq_threshold and max_size: + raise ValueError("cannot use freq_threshold param together with max_size param") + + if self.num_buckets is not None: + # See: merlin.core.dispatch.hash_series + warnings.warn( + "Performing a hash-based transformation. Do not " + "expect Categorify to be consistent on GPU and CPU " + "with this num_buckets setting!" + ) + + self.vocabs = {} + if vocabs is not None: + self.vocabs = self.process_vocabs(vocabs) + self.categories = deepcopy(self.vocabs)
+ +
[docs] @annotate("Categorify_fit", color="darkgreen", domain="nvt_python") + def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame): + # User passed in a list of column groups. We need to figure out + # if this list contains any multi-column groups, and if there + # are any (obvious) problems with these groups + columns_uniq = list(set(flatten(col_selector.names, container=tuple))) + columns_all = list(flatten(col_selector.names, container=tuple)) + if sorted(columns_all) != sorted(columns_uniq) and self.encode_type == "joint": + # If we are doing "joint" encoding, there must be unique mapping + # between input column names and column groups. Otherwise, more + # than one unique-value table could be used to encode the same + # column. + raise ValueError("Same column name included in multiple groups.") + + for group in col_selector.subgroups: + if len(group.names) > 1: + # For multi-column groups, we concatenate column names + # to get the "group" name. + name = _make_name(*group.names, sep=self.name_sep) + for col in group.names: + self.storage_name[col] = name + + # Check metadata type to reset on_host and cat_cache if the + # underlying ddf is already a pandas-backed collection + _cpu = False + if isinstance(ddf._meta, pd.DataFrame): + _cpu = True + self.on_host = False + # Cannot use "device" caching if the data is pandas-backed + self.cat_cache = "host" if self.cat_cache == "device" else self.cat_cache + if self.search_sorted: + # Pandas' search_sorted only works with Series. + # For now, it is safest to disallow this option. + self.search_sorted = False + warnings.warn("Cannot use `search_sorted=True` for pandas-backed data.") + + # convert tuples to lists + cols_with_vocabs = list(self.categories.keys()) + columns = [ + list(c) if isinstance(c, tuple) else c + for c in col_selector.grouped_names + if (_make_name(*c, sep=self.name_sep) if isinstance(c, tuple) else c) + not in cols_with_vocabs + ] + if not columns: + return Delayed("no-op", {"no-op": {}}) + + # Define a rough row-count at which we are likely to + # start hitting memory-pressure issues that cannot + # be accommodated with smaller partition sizes. + # By default, we estimate a "problematic" cardinality + # to be one that consumes >12.5% of the total memory. + self.cardinality_memory_limit = parse_bytes( + self.cardinality_memory_limit or int(device_mem_size(kind="total", cpu=_cpu) * 0.125) + ) + + dsk, key = _category_stats(ddf, self._create_fit_options_from_columns(columns)) + return Delayed(key, dsk)
+ +
[docs] def fit_finalize(self, categories): + idx_count = 0 + for cat in categories: + # this is a path + self.categories[cat] = categories[cat] + # check the argument + if self.single_table: + cat_file_path = self.categories[cat] + idx_count, new_cat_file_path = run_on_worker( + _reset_df_index, cat, cat_file_path, idx_count + ) + self.categories[cat] = new_cat_file_path
+ +
[docs] def clear(self): + """Clear the internal state of the operator's stats.""" + self.categories = deepcopy(self.vocabs)
+ +
[docs] def process_vocabs(self, vocabs): + """Process vocabs passed in by the user.""" + categories = {} + if isinstance(vocabs, dict) and all(dispatch.is_series_object(v) for v in vocabs.values()): + fit_options = self._create_fit_options_from_columns(list(vocabs.keys())) + base_path = os.path.join(self.out_path, fit_options.stat_name) + num_buckets = fit_options.num_buckets + os.makedirs(base_path, exist_ok=True) + for col, vocab in vocabs.items(): + col_name = _make_name(*col, sep=self.name_sep) if isinstance(col, tuple) else col + vals = {col_name: vocab} + oov_count = 1 + if num_buckets: + oov_count = ( + num_buckets if isinstance(num_buckets, int) else num_buckets[col_name] + ) or 1 + col_df = dispatch.make_df(vals).dropna() + col_df.index += NULL_OFFSET + oov_count + save_path = _save_encodings(col_df, base_path, col_name) + categories[col_name] = save_path + elif isinstance(vocabs, dict) and all(isinstance(v, str) for v in vocabs.values()): + # TODO: How to deal with the fact that this file may be missing null and oov rows?? + categories = { + (_make_name(*col, sep=self.name_sep) if isinstance(col, tuple) else col): path + for col, path in vocabs.items() + } + else: + error = """Unrecognized vocab type, + please provide either a dictionary with paths to parquet files + or a dictionary with pandas Series objects. + """ + raise ValueError(error) + + return categories
+ + def _create_fit_options_from_columns(self, columns) -> "FitOptions": + return FitOptions( + columns, + [], + [], + self.out_path, + self.freq_threshold, + self.split_out, + self.on_host, + concat_groups=self.encode_type == "joint", + name_sep=self.name_sep, + max_size=self.max_size, + num_buckets=self.num_buckets, + cardinality_memory_limit=self.cardinality_memory_limit, + split_every=self.split_every, + ) + +
[docs] def set_storage_path(self, new_path, copy=False): + self.categories = _copy_storage(self.categories, self.out_path, new_path, copy=copy) + self.out_path = new_path
+ +
[docs] @annotate("Categorify_transform", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + new_df = df.copy(deep=False) + if isinstance(self.freq_threshold, dict): + assert all(x in self.freq_threshold for x in col_selector.names) + + column_mapping = self.column_mapping(col_selector) + column_names = list(column_mapping.keys()) + + # Encode each column-group separately + for name in column_names: + try: + # Use the column-group `list` directly (not the string name) + use_name = column_mapping.get(name, name) + + # Storage name may be different than group for case (2) + # Only use the "aliased" `storage_name` if we are dealing with + # a multi-column group, or if we are doing joint encoding + if isinstance(use_name, (list, tuple)) and len(use_name) == 1: + use_name = use_name[0] + + if isinstance(use_name, (list, tuple)) and len(use_name) == 1: + use_name = use_name[0] + + if use_name != name or self.encode_type == "joint": + storage_name = self.storage_name.get(name, name) + else: + storage_name = name + + if isinstance(use_name, tuple): + use_name = list(use_name) + + path = self.categories[storage_name] + + encoded = _encode( + use_name, + storage_name, + path, + df, + self.cat_cache, + freq_threshold=self.freq_threshold[name] + if isinstance(self.freq_threshold, dict) + else self.freq_threshold, + search_sorted=self.search_sorted, + buckets=self.num_buckets, + encode_type=self.encode_type, + cat_names=column_names, + max_size=self.max_size, + dtype=self.output_dtype, + split_out=( + self.split_out.get(storage_name, 1) + if isinstance(self.split_out, dict) + else self.split_out + ), + single_table=self.single_table, + ) + new_df[name] = encoded + except Exception as e: + raise RuntimeError(f"Failed to categorical encode column {name}") from e + + return new_df
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + if self.encode_type == "combo": + for group in col_selector.grouped_names: + if isinstance(group, (tuple, list)): + name = _make_name(*group, sep=self.name_sep) + group = [*group] + else: + name = group + group = [group] + + column_mapping[name] = group + else: + column_mapping = super().column_mapping(col_selector) + return column_mapping
+ + def _compute_properties(self, col_schema, input_schema): + new_schema = super()._compute_properties(col_schema, input_schema) + col_name = col_schema.name + + category_name = self.storage_name.get(col_name, col_name) + target_category_path = self.categories.get(category_name, None) + + cardinality, dimensions = self.get_embedding_sizes([category_name])[category_name] + + to_add = { + "num_buckets": self.num_buckets[col_name] + if isinstance(self.num_buckets, dict) + else self.num_buckets, + "freq_threshold": self.freq_threshold[col_name] + if isinstance(self.freq_threshold, dict) + else self.freq_threshold, + "max_size": self.max_size[col_name] + if isinstance(self.max_size, dict) + else self.max_size, + "cat_path": target_category_path, + "domain": {"min": 0, "max": cardinality - 1, "name": category_name}, + "embedding_sizes": {"cardinality": cardinality, "dimension": dimensions}, + } + + return col_schema.with_properties({**new_schema.properties, **to_add}) + + @property + def output_tags(self): + return [Tags.CATEGORICAL] + + @property + def output_dtype(self): + return self.dtype or np.int64 + +
[docs] def compute_selector( + self, + input_schema: Schema, + selector: ColumnSelector, + parents_selector: ColumnSelector, + dependencies_selector: ColumnSelector, + ) -> ColumnSelector: + self._validate_matching_cols(input_schema, parents_selector, "computing input selector") + return parents_selector
+ +
[docs] def get_embedding_sizes(self, columns): + return _get_embeddings_dask(self.categories, columns, self.num_buckets)
+ +
[docs] def inference_initialize(self, columns, inference_config): + # we don't currently support 'combo' + if self.encode_type == "combo": + warnings.warn("Falling back to unoptimized inference path for encode_type 'combo' ") + return None + import nvtabular_cpp + + return nvtabular_cpp.inference.CategorifyTransform(self)
+ + transform.__doc__ = Operator.transform.__doc__ + fit.__doc__ = StatOperator.fit.__doc__ + fit_finalize.__doc__ = StatOperator.fit_finalize.__doc__
+ + +def get_embedding_sizes(source, output_dtypes=None): + """Returns a dictionary of embedding sizes from a workflow or workflow_node + + Parameters + ---------- + source : Workflow or ColumnSelector + Either a nvtabular Workflow or ColumnSelector object that we should use to find + embedding sizes + output_dtypes : dict, optional + Optional dictionary of column_name:dtype. If passing a workflow object dtypes + will be read from the workflow. This is used to figure out which columns + are multihot-categorical, which are split out by this function. If passed a workflow_node + and this parameter isn't set, you won't have multihot columns returned separately + """ + # TODO: do we need to distinguish multihot columns here? (if so why? ) + + # have to lazy import Workflow to avoid circular import errors + from nvtabular.workflow import Workflow + + output_node = source.output_node if isinstance(source, Workflow) else source + + if isinstance(source, Workflow): + output_dtypes = output_dtypes or source.output_dtypes + else: + # passed in a column group + output_dtypes = output_dtypes or {} + + output = {} + multihot_columns = set() + cats_schema = output_node.output_schema.select_by_tag(Tags.CATEGORICAL) + for col_name, col_schema in cats_schema.column_schemas.items(): + if col_schema.dtype and col_schema.is_list and col_schema.is_ragged: + # multi hot so remove from output and add to multihot + multihot_columns.add(col_name) + + embeddings_sizes = col_schema.properties.get("embedding_sizes", {}) + cardinality = embeddings_sizes["cardinality"] + dimensions = embeddings_sizes["dimension"] + output[col_name] = (cardinality, dimensions) + + # TODO: returning different return types like this (based off the presence + # of multihot features) is pretty janky. fix. + if not multihot_columns: + return output + + single_hots = {k: v for k, v in output.items() if k not in multihot_columns} + multi_hots = {k: v for k, v in output.items() if k in multihot_columns} + return single_hots, multi_hots + + +def _get_embeddings_dask(paths, cat_names, buckets=0): + embeddings = {} + if isinstance(buckets, int): + buckets = {name: buckets for name in cat_names} + for col in cat_names: + path = paths.get(col) + num_rows = OOV_OFFSET + if path: + for file_frag in pa_ds.dataset(path, format="parquet").get_fragments(): + num_rows += file_frag.metadata.num_rows + if isinstance(buckets, dict): + bucket_size = buckets.get(col, 0) + elif isinstance(buckets, int): + bucket_size = buckets + else: + bucket_size = 1 + num_rows += bucket_size + embeddings[col] = _emb_sz_rule(num_rows) + return embeddings + + +def _emb_sz_rule(n_cat: int, minimum_size=16, maximum_size=512) -> int: + return n_cat, min(max(minimum_size, round(1.6 * n_cat**0.56)), maximum_size) + + +def _make_name(*args, sep="_"): + return sep.join(args) + + +def _to_parquet_dask_lazy(df, path, write_index=False): + # Write DataFrame data to parquet (lazily) with dask + + # Check if we already have a dask collection + is_collection = isinstance(df, DaskDataFrame) + + # Use `ddf.to_parquet` method + kwargs = { + "overwrite": True, + "compute": False, + "write_index": write_index, + "schema": None, + } + return ( + df + if is_collection + else dispatch.convert_data( + df, + cpu=isinstance(df, pd.DataFrame), + to_collection=True, + ) + ).to_parquet(path, **kwargs) + + +def _save_encodings( + df, + base_path, + field_name, + preserve_index=False, + first_n=None, + freq_threshold=None, + oov_count=1, + null_size=None, +): + # Write DataFrame data to parquet (eagerly) with dask + + # Define paths + unique_path = "/".join([str(base_path), f"unique.{field_name}.parquet"]) + meta_path = "/".join([str(base_path), f"meta.{field_name}.parquet"]) + + # Check if we already have a dask collection + is_collection = isinstance(df, DaskDataFrame) + + # Create empty directory if it doesn't already exist + use_directory = is_collection and df.npartitions > 1 + fs = get_fs_token_paths(unique_path, mode="wb")[0] + _path = fs._strip_protocol(unique_path) + if fs.isdir(_path) or fs.exists(_path): + fs.rm(_path, recursive=True) + if use_directory: + fs.mkdir(_path, exists_ok=True) + + # Start tracking embedding metadata + record_size_meta = True + oov_size = 0 + unique_count = 0 + unique_size = 0 + + # Iterate over partitions and write to disk + size = oov_count + OOV_OFFSET # Reserve null and oov buckets + for p, part in enumerate(df.partitions if is_collection else [df]): + local_path = "/".join([unique_path, f"part.{p}.parquet"]) if use_directory else unique_path + _df = _compute_sync(part) if is_collection else part + _len = len(_df) + if _len == 0: + continue + + size_col = f"{field_name}_size" + if size_col not in _df.columns: + record_size_meta = False + + if record_size_meta: + # Set number of rows allowed from this part + if first_n is not None: + first_n_local = first_n - size + else: + first_n_local = _len + + # Update oov size + if first_n or freq_threshold: + removed = None + if freq_threshold: + sizes = _df[size_col] + removed = df[(sizes < freq_threshold) & (sizes > 0)] + _df = _df[(sizes >= freq_threshold) | (sizes == 0)] + if first_n and _len > first_n_local: + removed = _df.iloc[first_n_local:] + _df = _df.iloc[:first_n_local] + if removed is not None: + oov_size += removed[size_col].sum() + _len = len(_df) + + # Record unique-value metadata + unique_size += _df[size_col].sum() + + if not preserve_index: + # If we are NOT writing the index of df, + # then make sure we are writing a "correct" + # index. Note that we avoid using ddf.to_parquet + # so that we can make sure the index is correct + _df.set_index( + pd.RangeIndex( + start=size, + stop=size + _len, + step=1, + ), + drop=True, + inplace=True, + ) + + size += _len + unique_count += _len + _df.to_parquet(local_path, compression=None) + if first_n and size >= first_n: + break # Ignore any remaining files + + # Write encoding metadata + meta = { + "kind": ["pad", "null", "oov", "unique"], + "offset": [PAD_OFFSET, NULL_OFFSET, OOV_OFFSET, OOV_OFFSET + oov_count], + "num_indices": [1, 1, oov_count, unique_count], + } + if record_size_meta: + meta["num_observed"] = [0, null_size, oov_size, unique_size] + type(_df)(meta).to_parquet(meta_path) + + # Return path to uniques + return unique_path + + +@dataclass +class FitOptions: + """Contains options on how to fit statistics. + + Parameters + ---------- + col_groups: list + Columns to group by + agg_cols: list + For groupby statistics, this is the list of continuous columns to calculate statistics + for + agg_list: list + List of operations (sum/max/...) to perform on the grouped continuous columns + out_path: str + Where to write statistics in parquet format + freq_limit: int or dict + Categories with a count/frequency below this threshold will be + omitted from the encoding and corresponding data will be mapped + to the "null" category. + split_out: + Number of output partitions to use for each category in ``fit``. + on_host: + Whether to convert cudf data to pandas between tasks in the groupby reduction. + stat_name: + Name of statistic to use when writing out statistics + concat_groups: + Whether to use a 'joint' vocabulary between columns + name_sep: + Delimiter to use for concatenating columns into a string + max_size: + The maximum size of an embedding table + num_buckets: + If specified will also do hashing operation for values that would otherwise be mapped + to as unknown (by freq_limit or max_size parameters) + cardinality_memory_limit: int + Suggested upper limit on categorical data containers. + split_every: + Number of adjacent partitions to reduce in each tree node. + """ + + col_groups: list + agg_cols: list + agg_list: list + out_path: str + freq_limit: Union[int, dict] + split_out: Union[int, dict] + on_host: bool + stat_name: str = "categories" + concat_groups: bool = False + name_sep: str = "-" + max_size: Optional[Union[int, dict]] = None + num_buckets: Optional[Union[int, dict]] = None + cardinality_memory_limit: Optional[int] = None + split_every: Optional[Union[int, dict]] = 8 + + def __post_init__(self): + if not isinstance(self.col_groups, ColumnSelector): + self.col_groups = ColumnSelector(self.col_groups) + + col_selectors = [] + for cat_col_names in self.col_groups.grouped_names: + if isinstance(cat_col_names, tuple): + cat_col_names = list(cat_col_names) + + if isinstance(cat_col_names, str): + cat_col_names = [cat_col_names] + + if not isinstance(cat_col_names, ColumnSelector): + cat_col_selector = ColumnSelector(cat_col_names) + else: + cat_col_selector = cat_col_names + + col_selectors.append(cat_col_selector) + + self.col_groups = col_selectors + + +def _general_concat( + frames, + cardinality_memory_limit=False, + col_selector=None, + **kwargs, +): + # Concatenate DataFrame or pa.Table objects + if isinstance(frames[0], pa.Table): + df = pa.concat_tables(frames, promote=True) + if ( + cardinality_memory_limit + and col_selector is not None + and df.nbytes > cardinality_memory_limit + ): + # Before fully converting this pyarrow Table + # to a cudf DatFrame, we can reduce the memory + # footprint of `df`. Since the size of `df` + # depends on the cardinality of the features, + # and NOT on the partition size, the remaining + # logic in this function has an OOM-error risk + # (even with tiny partitions). + size_columns = [] + for col in col_selector.names: + name = col + "_size" + if name in df.schema.names: + # Convert this column alone to cudf, + # and drop the field from df. Note that + # we are only converting this column to + # cudf to take advantage of fast `max` + # performance. + size_columns.append(dispatch.from_host(df.select([name]))) + df = df.drop([name]) + # Use numpy to calculate the "minimum" + # dtype needed to capture the "size" column, + # and cast the type + typ = np.min_scalar_type(size_columns[-1][name].max() * 2) + size_columns[-1][name] = size_columns[-1][name].astype(typ) + # Convert the remaining columns in df to cudf, + # and append the type-casted "size" columns + df = dispatch.concat_columns([dispatch.from_host(df)] + size_columns) + else: + # Empty DataFrame - No need for type-casting + df = dispatch.from_host(df) + return df + else: + # For now, if we are not concatenating in host memory, + # we will assume that reducing the memory footprint of + # "size" columns is not a priority. However, the same + # type-casting optimization can also be done for both + # pandas and cudf-backed data here. + return _concat(frames, **kwargs) + + +@annotate("top_level_groupby", color="green", domain="nvt_python") +def _top_level_groupby(df, options: FitOptions = None, spill=True): + assert options is not None + sum_sq = "std" in options.agg_list or "var" in options.agg_list + calculate_min = "min" in options.agg_list + calculate_max = "max" in options.agg_list + # Top-level operation for category-based groupby aggregations + output = {} + k = 0 + for i, cat_col_names in enumerate(options.col_groups): + if not isinstance(cat_col_names, ColumnSelector): + cat_col_selector = ColumnSelector(cat_col_names) + else: + cat_col_selector = cat_col_names + + cat_col_selector_str = _make_name(*cat_col_selector.names, sep=options.name_sep) + + if options.concat_groups and len(cat_col_selector.names) > 1: + # Concatenate columns and replace cat_col_group + # with the single name + df_gb = type(df)() + ignore_index = True + df_gb[cat_col_selector_str] = _concat( + [_maybe_flatten_list_column(col, df)[col] for col in cat_col_selector.names], + ignore_index, + ) + cat_col_selector = ColumnSelector([cat_col_selector_str]) + else: + # Compile aggregation dictionary and add "squared-sum" + # column(s) (necessary when `agg_cols` is non-empty) + combined_col_selector = cat_col_selector + options.agg_cols + + df_gb = df[combined_col_selector.names].copy(deep=False) + + agg_dict = {} + base_aggs = [] + if "size" in options.agg_list: + # This is either for a Categorify operation, + # or "size" is in the list of aggregations + base_aggs.append("size") + if set(options.agg_list).difference({"size", "min", "max"}): + # This is a groupby aggregation that may + # require "count" statistics + base_aggs.append("count") + agg_dict[cat_col_selector.names[0]] = base_aggs + if isinstance(options.agg_cols, list): + options.agg_cols = ColumnSelector(options.agg_cols) + for col in options.agg_cols.names: + agg_dict[col] = ["sum"] + if sum_sq: + name = _make_name(col, "pow2", sep=options.name_sep) + df_gb[name] = df_gb[col].pow(2) + agg_dict[name] = ["sum"] + + if calculate_min: + agg_dict[col].append("min") + if calculate_max: + agg_dict[col].append("max") + + # Perform groupby and flatten column index + # (flattening provides better cudf/pd support) + df_gb = _maybe_flatten_list_column(cat_col_selector.names[0], df_gb) + # NOTE: groupby(..., dropna=False) requires pandas>=1.1.0 + gb = df_gb.groupby(cat_col_selector.names, dropna=False).agg(agg_dict) + gb.columns = [ + _make_name(*(tuple(cat_col_selector.names) + name[1:]), sep=options.name_sep) + if name[0] == cat_col_selector.names[0] + else _make_name(*(tuple(cat_col_selector.names) + name), sep=options.name_sep) + for name in gb.columns.to_flat_index() + ] + gb.reset_index(inplace=True, drop=False) + del df_gb + + # Extract null groups into gb_null + isnull = gb.isnull().any(axis=1) + gb_null = gb[~isnull] + gb = gb[isnull] + if not len(gb_null): + gb_null = None + del isnull + + # Split the result by the hash value of the categorical column + nsplits = options.split_out[cat_col_selector_str] + for j, split in shuffle_group( + gb, cat_col_selector.names, 0, nsplits, nsplits, True, nsplits + ).items(): + if gb_null is not None: + # Guarantee that the first split will contain null groups + split = _concat([gb_null, split], ignore_index=True) + gb_null = None + if spill and options.on_host and not is_cpu_object(split): + output[k] = split.to_arrow(preserve_index=False) + else: + output[k] = split + k += 1 + del gb + return output + + +@annotate("mid_level_groupby", color="green", domain="nvt_python") +def _mid_level_groupby(dfs, col_selector: ColumnSelector, options: FitOptions, spill=True): + if options.concat_groups and len(col_selector.names) > 1: + col_selector = ColumnSelector([_make_name(*col_selector.names, sep=options.name_sep)]) + + df = _general_concat(dfs, ignore_index=True) + groups = df.groupby(col_selector.names, dropna=False) + gb = groups.agg( + {col: _get_aggregation_type(col) for col in df.columns if col not in col_selector.names} + ) + gb.reset_index(drop=False, inplace=True) + + if spill and options.on_host and not is_cpu_object(gb): + gb_pd = gb.to_arrow(preserve_index=False) + del gb + return gb_pd + return gb + + +@annotate("bottom_level_groupby", color="green", domain="nvt_python") +def _bottom_level_groupby(dfs, col_selector: ColumnSelector, options: FitOptions, spill=True): + gb = _mid_level_groupby(dfs, col_selector, options, spill=False) + if options.concat_groups and len(col_selector.names) > 1: + col_selector = ColumnSelector([_make_name(*col_selector.names, sep=options.name_sep)]) + + name_count = _make_name(*(col_selector.names + ["count"]), sep=options.name_sep) + name_size = _make_name(*(col_selector.names + ["size"]), sep=options.name_sep) + + required = col_selector.names.copy() + if "count" in options.agg_list: + required.append(name_count) + if "size" in options.agg_list: + required.append(name_size) + ddof = 1 + if isinstance(options.agg_cols, list): + options.agg_cols = ColumnSelector(options.agg_cols) + for cont_col in options.agg_cols.names: + name_sum = _make_name(*(col_selector.names + [cont_col, "sum"]), sep=options.name_sep) + if "sum" in options.agg_list: + required.append(name_sum) + + if "mean" in options.agg_list: + name_mean = _make_name(*(col_selector.names + [cont_col, "mean"]), sep=options.name_sep) + required.append(name_mean) + gb[name_mean] = gb[name_sum] / gb[name_count] + + if "min" in options.agg_list: + name_min = _make_name(*(col_selector.names + [cont_col, "min"]), sep=options.name_sep) + required.append(name_min) + + if "max" in options.agg_list: + name_max = _make_name(*(col_selector.names + [cont_col, "max"]), sep=options.name_sep) + required.append(name_max) + + if "var" in options.agg_list or "std" in options.agg_list: + n = gb[name_count] + x = gb[name_sum] + x2 = gb[ + _make_name(*(col_selector.names + [cont_col, "pow2", "sum"]), sep=options.name_sep) + ] + result = x2 - x**2 / n + div = n - ddof + div[div < 1] = 1 + result /= div + result[(n - ddof) == 0] = np.nan + + if "var" in options.agg_list: + name_var = _make_name( + *(col_selector.names + [cont_col, "var"]), sep=options.name_sep + ) + required.append(name_var) + gb[name_var] = result + if "std" in options.agg_list: + name_std = _make_name( + *(col_selector.names + [cont_col, "std"]), sep=options.name_sep + ) + required.append(name_std) + gb[name_std] = np.sqrt(result) + + if spill and options.on_host and not is_cpu_object(gb[required]): + gb_pd = gb[required].to_arrow(preserve_index=False) + del gb + return gb_pd + return gb[required] + + +def _get_aggregation_type(col): + if col.endswith("_min"): + return "min" + elif col.endswith("_max"): + return "max" + else: + return "sum" + + +@annotate("write_uniques", color="green", domain="nvt_python") +def _write_uniques( + dfs, + base_path, + col_selector: ColumnSelector, + options: FitOptions, + cpu: bool, + path: str = None, +): + """Writes out a dataframe to a parquet file. + + Parameters + ---------- + dfs : DataFrame + base_path : str + col_selector : + options : FitOptions + + Raises + ------ + ValueError + If the computed nlargest value is non-positive. + + Returns + ------- + path : str + the path to the output parquet file. + + """ + if options.concat_groups and len(col_selector.names) > 1: + col_selector = ColumnSelector([_make_name(*col_selector.names, sep=options.name_sep)]) + + # Set max_emb_size + # This is the maximum number of rows we will write to + # the unique-value parquet files + col_name = col_selector.names[0] + max_emb_size = options.max_size + if max_emb_size: + max_emb_size = max_emb_size[col_name] if isinstance(max_emb_size, dict) else max_emb_size + + # Set num_buckets + # This is the maximum number of indices + num_buckets = options.num_buckets + if num_buckets: + num_buckets = num_buckets if isinstance(num_buckets, int) else num_buckets[col_name] + oov_count = num_buckets or 1 + + # Set freq_threshold + # This is the minimum unique count for a distinct + # category to be included in the unique-value files + freq_threshold = options.freq_limit + if freq_threshold: + freq_threshold = ( + freq_threshold if isinstance(freq_threshold, int) else freq_threshold[col_name] + ) + + # Sanity check + if max_emb_size and max_emb_size < oov_count + 2: + raise ValueError( + "`max_size` can never be less than the maximum of " + "`num_buckets + 2` and `3`, because we must always " + "reserve pad, null and at least 1 oov-bucket index." + ) + + null_size = None + if path: + # We have a parquet path to construct uniques from + # (rather than a list of DataFrame objects) + df = dispatch.read_dispatch(cpu=cpu, collection=True)( + path, + split_row_groups=False, + ).reset_index(drop=True) + + # Check if we need to compute the DataFrame collection + # of unique values. For now, we can avoid doing this when + # we are not jointly encoding multiple columns + if simple := (len(col_selector.names) == 1 and df.npartitions > 1): + col_name = col_selector.names[0] + name_size = col_name + "_size" + has_size = name_size in df + try: + # Sort by col_name + df = df.sort_values(col_name, na_position="first") + except (NotImplementedError, TypeError): + # Dask-based sort failed - Need to compute first + simple = False + + # At this point, `simple` may have changed from True to False + # if the backend library failed to sort by the target column. + if simple: + # Define the null row + def _drop_first_row(part, index): + return part.iloc[1:] if index == (0,) else part + + null_row = df.head(1) + if null_row[col_name].iloc[:1].isnull().any(): + df = df.map_partitions(_drop_first_row, BlockIndex((df.npartitions,))) + if has_size: + null_size = null_row[name_size].iloc[0] + else: + null_size = 0 + + # Sort by size (without null and oov rows) + if has_size: + # Avoid using dask_cudf to calculate divisions + # (since it may produce too-few partitions) + with config.set({"dataframe.shuffle.method": "tasks"}): + df = df.sort_values(name_size, ascending=False) + + unique_path = _save_encodings( + df, + base_path, + _make_name(*col_selector.names, sep=options.name_sep), + first_n=max_emb_size, + freq_threshold=freq_threshold, + oov_count=oov_count, + null_size=null_size, + ) + + # TODO: Delete temporary parquet file(s) now thet the final + # uniques are written to disk? (May not want to wait on deletion) + return unique_path + + # If we have reached this point, we have a dask collection + # that must be computed before continuing + df = _compute_sync(df) + else: + # We have a list of DataFrame objects. + # Collect aggregation results into single frame + df = _general_concat( + dfs, + cardinality_memory_limit=options.cardinality_memory_limit, + col_selector=col_selector, + ignore_index=True, + ) + + # Check if we should warn user that this Column is likely + # to cause memory-pressure issues + _df_size = df.memory_usage(deep=True, index=True).sum() + if (_df_size > options.cardinality_memory_limit) if options.cardinality_memory_limit else False: + warnings.warn( + f"Category DataFrame (with columns: {df.columns}) is {_df_size} " + f"bytes in size. This is large compared to the suggested " + f"upper limit of {options.cardinality_memory_limit} bytes!" + f"(12.5% of the total memory by default)" + ) + + if len(df): + # Make sure first category is Null. + # Use ignore_index=True to avoid allocating memory for + # an index we don't even need + df = df.sort_values(col_selector.names, na_position="first", ignore_index=True) + name_size_multi = "_".join(col_selector.names + ["size"]) + has_size = name_size_multi in df + + # Check if we already have a null row + has_nans = df[col_selector.names].iloc[0].transpose().isnull().all() + if hasattr(has_nans, "iloc"): + has_nans = has_nans[0] + + if has_nans: + if has_size: + null_size = df[name_size_multi].iloc[0] + df = df.iloc[1:] + else: + null_size = 0 + if has_size: + df = df.sort_values(name_size_multi, ascending=False, ignore_index=True) + df_write = df + else: + if hasattr(df, "convert_dtypes"): + df = df.convert_dtypes() + df_null = type(df)({c: [None] for c in col_selector.names}) + for c in col_selector.names: + df_null[c] = df_null[c].astype(df[c].dtype) + df_write = df_null + + unique_path = _save_encodings( + df_write, + base_path, + _make_name(*col_selector.names, sep=options.name_sep), + first_n=max_emb_size, + freq_threshold=freq_threshold, + oov_count=oov_count, + null_size=null_size, + ) + del df + del df_write + return unique_path + + +def _finish_labels(paths, cols): + return {col: paths[i] for i, col in enumerate(cols)} + + +def _groupby_to_disk(ddf, write_func, options: FitOptions): + if not options.col_groups: + raise ValueError("no column groups to aggregate") + + if options.concat_groups: + if options.agg_list and not set(options.agg_list).issubset({"count", "size"}): + raise ValueError( + "Cannot use concat_groups=True with aggregations other than count and size" + ) + if options.agg_cols: + raise ValueError("Cannot aggregate continuous-column stats with concat_groups=True") + + # Update split_out and split_every + so, se = {}, {} + for col in options.col_groups: + col = [col] if isinstance(col, str) else col + if isinstance(col, tuple): + col = list(col) + col_str = _make_name(*col.names, sep=options.name_sep) + + for _d, _opt, _default in [ + (so, options.split_out, 1), + (se, options.split_every, 8), + ]: + if _opt is None: + _d[col_str] = _default + elif isinstance(_opt, int): + _d[col_str] = _opt + else: + _d[col_str] = _opt.get(col_str, _default) + + options.split_out = so + options.split_every = se + + # Make dedicated output directory for the categories + fs = get_fs_token_paths(options.out_path)[0] + out_path = fs.sep.join([options.out_path, options.stat_name]) + fs.mkdirs(out_path, exist_ok=True) + + dsk = {} + token = tokenize( + ddf, + options.col_groups, + options.out_path, + options.freq_limit, + options.split_out, + options.split_every, + options.on_host, + ) + split_name = "split-" + token + reduce_1_name = "reduce_1-" + token + reduce_3_name = "reduce_3-" + token + finalize_labels_name = options.stat_name + "-" + token + + # Use map_partitions to improve task fusion + grouped = ddf.to_bag(format="frame").map_partitions( + _top_level_groupby, options=options, token="level_1" + ) + _grouped_meta = _top_level_groupby(ddf._meta, options=options) + _grouped_meta_col = {} + + dsk_split = defaultdict(dict) + for p in range(ddf.npartitions): + k = 0 + for c, col in enumerate(options.col_groups): + col = [col] if isinstance(col, str) else col + col_str = _make_name(*col.names, sep=options.name_sep) + _grouped_meta_col[c] = _grouped_meta[k] + for s in range(options.split_out[col_str]): + dsk_split[c][(split_name, p, c, s)] = (getitem, (grouped.name, p), k) + k += 1 + + col_groups_str = [] + col_group_frames = [] + for c, col in enumerate(options.col_groups): + col = [col] if isinstance(col, str) else col + col_str = _make_name(*col.names, sep=options.name_sep) + col_groups_str.append(col_str) + reduce_2_name = f"reduce_2-{c}-" + token + for s in range(options.split_out[col_str]): + split_every = options.split_every[col_str] + parts = ddf.npartitions + widths = [parts] + while parts > 1: + parts = math.ceil(parts / split_every) + widths.append(int(parts)) + height = len(widths) + if height >= 2: + # Loop over reduction levels + for depth in range(1, height): + # Loop over reduction groups + for group in range(widths[depth]): + # Calculate inputs for the current group + p_max = widths[depth - 1] + lstart = split_every * group + lstop = min(lstart + split_every, p_max) + if depth == 1: + # Input nodes are from input layer + input_keys = [(split_name, p, c, s) for p in range(lstart, lstop)] + else: + # Input nodes are tree-reduction nodes + input_keys = [ + (reduce_1_name, p, c, s, depth - 1) for p in range(lstart, lstop) + ] + + # Define task + if depth == height - 1: + # Final Node + assert ( + group == 0 + ), f"group = {group}, not 0 for final tree reduction task" + dsk_split[c][(reduce_2_name, s)] = ( + _bottom_level_groupby, + input_keys, + col, + options, + False, + ) + else: + # Intermediate Node + dsk_split[c][(reduce_1_name, group, c, s, depth)] = ( + _mid_level_groupby, + input_keys, + col, + options, + ) + else: + # Deal with single-partition case + dsk_split[c][(reduce_2_name, s)] = ( + _bottom_level_groupby, + [(split_name, 0, c, s)], + col, + options, + False, + ) + + # Make DataFrame collection for column-group result + _meta = _bottom_level_groupby( + [_grouped_meta_col[c]], + col, + options, + spill=False, + ) + _divisions = (None,) * (options.split_out[col_str] + 1) + graph = HighLevelGraph.from_collections(reduce_2_name, dsk_split[c], dependencies=[grouped]) + col_group_frames.append(new_dd_object(graph, reduce_2_name, _meta, _divisions)) + + # Write data to (possibly temporary) parquet files + cpu = isinstance(col_group_frames[-1]._meta, pd.DataFrame) + if write_func is None: + # Write results directly to disk, and use + # a final "barrier" task + if options.concat_groups and len(col) > 1: + col_selector = ColumnSelector([_make_name(*col.names, sep=options.name_sep)]) + else: + col_selector = col + rel_path = "cat_stats.%s.parquet" % ( + _make_name(*col_selector.names, sep=options.name_sep) + ) + path = os.path.join(out_path, rel_path) + col_group_frames[-1] = _to_parquet_dask_lazy(col_group_frames[-1], path) + # Barrier-only task + dsk[(reduce_3_name, c)] = ( + lambda keys, path: path, + col_group_frames[-1].__dask_keys__(), + path, + ) + else: + # Possibly write data to temporary parquet files, + # and perform write operation(s) in final `write_func` task + assert callable(write_func) + if col_group_frames[-1].npartitions > 1 and write_func.__name__ == "_write_uniques": + path = os.path.join(out_path, f"tmp.uniques.{col_str}") + col_group_frames[-1] = _to_parquet_dask_lazy(col_group_frames[-1], path) + else: + path = None + # Write + barrier task + dsk[(reduce_3_name, c)] = ( + write_func, + col_group_frames[-1].__dask_keys__(), + out_path, + col, + options, + cpu, + path, + ) + + # Tie everything together into a graph with a single output key + dsk[finalize_labels_name] = ( + _finish_labels, + [(reduce_3_name, c) for c, col in enumerate(options.col_groups)], + col_groups_str, + ) + graph = HighLevelGraph.from_collections( + finalize_labels_name, dsk, dependencies=col_group_frames + ) + return graph, finalize_labels_name + + +def _category_stats(ddf, options: FitOptions): + # Check if we only need categories + if options.agg_cols == [] and options.agg_list == []: + options.agg_list = ["size"] + return _groupby_to_disk(ddf, _write_uniques, options) + + # Otherwise, getting category-statistics + if isinstance(options.agg_cols, str): + options.agg_cols = [options.agg_cols] + if options.agg_list == []: + options.agg_list = ["count"] + + return _groupby_to_disk(ddf, None, options) + + +def _encode( + name, + storage_name, + path, + df, + cat_cache, + freq_threshold=0, + search_sorted=False, + buckets=None, + encode_type="joint", + cat_names=None, + max_size=0, + dtype=None, + split_out=1, + single_table=False, +): + """The _encode method is responsible for transforming a dataframe by taking the written + out vocabulary file and looking up values to translate inputs to numeric + outputs. + + Parameters + ---------- + name : + storage_name : dict + path : str + df : DataFrame + cat_cache : + freq_threshold : int + Categories with a count or frequency below this threshold will + be omitted from the encoding and corresponding data will be + mapped to the "Null" category. Defaults to 0. + search_sorted : + Defaults to False. + buckets : + Defaults to None. + encode_type : + Defaults to "joint". + cat_names : + Defaults to None. + max_size : + Defaults to 0. + dtype : + Defaults to None. + + Returns + ------- + labels : numpy ndarray or Pandas Series + + """ + if isinstance(buckets, int): + buckets = {name: buckets for name in cat_names} + value = None + selection_l = ColumnSelector(name if isinstance(name, list) else [name]) + selection_r = ColumnSelector(name if isinstance(name, list) else [storage_name]) + list_col = is_list_col(selection_l, df) + + # Find number of oov buckets + if buckets and storage_name in buckets: + num_oov_buckets = buckets[storage_name] + search_sorted = False + else: + num_oov_buckets = 1 + + if path: + read_pq_func = dispatch.read_dispatch( + df, + fmt="parquet", + collection=split_out > 1, + ) + if cat_cache is not None and split_out == 1: + cat_cache = ( + cat_cache if isinstance(cat_cache, str) else cat_cache.get(storage_name, "disk") + ) + if len(df): + with get_worker_cache("cats") as cache: + value = fetch_table_data( + cache, + path, + columns=selection_r.names, + cache=cat_cache, + cats_only=True, + reader=read_pq_func, + ) + if len(value) and value["labels"].iloc[0] < OOV_OFFSET + num_oov_buckets: + # See: https://github.com/rapidsai/cudf/issues/12837 + value["labels"] += OOV_OFFSET + num_oov_buckets + else: + value = read_pq_func( # pylint: disable=unexpected-keyword-arg + path, + columns=selection_r.names, + **({"split_row_groups": False} if split_out > 1 else {}), + ) + + value.index = value.index.rename("labels") + if split_out > 1: + value = value.reset_index(drop=False) + if type(df).__module__.split(".")[0] == "cudf": + # `cudf.read_parquet` may drop the RangeIndex, so we need + # to use the parquet metadata to set a proper RangeIndex. + # We can avoid this workaround for cudf>=23.04 + # (See: https://github.com/rapidsai/cudf/issues/12837) + ranges, size = [], OOV_OFFSET + num_oov_buckets + for file_frag in pa_ds.dataset(path, format="parquet").get_fragments(): + part_size = file_frag.metadata.num_rows + ranges.append((size, size + part_size)) + size += part_size + value["labels"] = dd.from_map(lambda r: pd.RangeIndex(*r), ranges) + else: + value.reset_index(drop=False, inplace=True) + + if value is None: + value = type(df)() + for c in selection_r.names: + typ = df[selection_l.names[0]].dtype if len(selection_l.names) == 1 else df[c].dtype + value[c] = nullable_series([None], df, typ) + value.index = value.index.rename("labels") + value.reset_index(drop=False, inplace=True) + + use_collection = isinstance(value, DaskDataFrame) + if use_collection and value.npartitions == 1: + # Use simple merge for single-partition case + value = _compute_sync(value) + use_collection = False + + # Determine encoding offsets + null_encoding_offset = value["labels"].head(1).iloc[0] if single_table else NULL_OFFSET + bucket_encoding_offset = null_encoding_offset + 1 # 2 (if not single_table) + distinct_encoding_offset = bucket_encoding_offset + num_oov_buckets + + # Determine indices of "real" null values + # (these will always be encoded to `1`) + expr = df[selection_l.names[0]].isna() + for _name in selection_l.names[1:]: + expr = expr & df[_name].isna() + nulls = df[expr].index.values + + if use_collection or not search_sorted: + if list_col: + codes = dispatch.flatten_list_column(df[selection_l.names[0]]) + codes["order"] = dispatch.arange(len(codes), like_df=df) + else: + # We go into this case + codes = type(df)({"order": dispatch.arange(len(df), like_df=df)}, index=df.index) + + for cl, cr in zip(selection_l.names, selection_r.names): + if isinstance(df[cl].dropna().iloc[0], (np.ndarray, list)): + ser = df[cl].copy() + codes[cl] = dispatch.flatten_list_column_values(ser).astype(value[cr].dtype) + else: + codes[cl] = df[cl].copy().astype(value[cr].dtype) + + indistinct = bucket_encoding_offset + if buckets and storage_name in buckets: + # apply hashing for "infrequent" categories + indistinct = ( + _hash_bucket(df, buckets, selection_l.names, encode_type=encode_type) + + bucket_encoding_offset + ) + + if use_collection: + # Manual broadcast merge + merged_df = _concat( + [ + codes.merge( + _compute_sync(part), + left_on=selection_l.names, + right_on=selection_r.names, + how="left", + ).dropna(subset=["labels"]) + for part in value.partitions + ], + ignore_index=False, + ).sort_values("order") + else: + merged_df = codes.merge( + value, left_on=selection_l.names, right_on=selection_r.names, how="left" + ).sort_values("order") + + merged_df.reset_index(drop=True, inplace=True) + if len(merged_df) < len(codes): + # Missing nulls + labels = df._constructor_sliced(indistinct) + labels.iloc[merged_df["order"]] = merged_df["labels"] + labels = labels.values + else: + merged_df["labels"].fillna(df._constructor_sliced(indistinct), inplace=True) + labels = merged_df["labels"].values + else: + # no hashing + if use_collection: + # Manual broadcast merge + merged_df = _concat( + [ + codes.merge( + _compute_sync(part), + left_on=selection_l.names, + right_on=selection_r.names, + how="left", + ).dropna(subset=["labels"]) + for part in value.partitions + ], + ignore_index=True, + ) + if len(merged_df) < len(codes): + # Missing nulls + labels = codes._constructor_sliced( + np.full( + len(codes), + indistinct, + like=merged_df["labels"].values, + ), + ) + labels.iloc[merged_df["order"]] = merged_df["labels"] + else: + labels = merged_df.sort_values("order")["labels"].reset_index(drop=True) + else: + labels = codes.merge( + value, left_on=selection_l.names, right_on=selection_r.names, how="left" + ).sort_values("order")["labels"] + labels.fillna(indistinct, inplace=True) + labels = labels.values + else: + # Use `searchsorted` if we are using a "full" encoding + if list_col: + labels = ( + value[selection_r.names].searchsorted( + df[selection_l.names[0]].list.leaves, side="left", na_position="first" + ) + + distinct_encoding_offset + ) + else: + labels = ( + value[selection_r.names].searchsorted( + df[selection_l.names], side="left", na_position="first" + ) + + distinct_encoding_offset + ) + labels[labels >= len(value[selection_r.names])] = bucket_encoding_offset + + # Make sure nulls are encoded to `null_encoding_offset` + # (This should be `1` in most casese) + if len(nulls): + labels[nulls] = null_encoding_offset + + if list_col: + labels = dispatch.encode_list_column(df[selection_l.names[0]], labels, dtype=dtype) + elif dtype: + labels = labels.astype(dtype, copy=False) + + return labels + + +def _read_groupby_stat_df(path, name, cat_cache, read_pq_func): + if cat_cache is not None: + cat_cache = cat_cache if isinstance(cat_cache, str) else cat_cache.get(name, "disk") + with get_worker_cache("stats") as cache: + if cache: + return fetch_table_data(cache, path, cache=cat_cache, reader=read_pq_func) + return read_pq_func(path) + + +def is_list_col(col_selector, df): + if isinstance(col_selector, list): + col_selector = ColumnSelector(col_selector) + has_lists = any(dispatch.is_list_dtype(df[col]) for col in col_selector.names) + if has_lists and len(col_selector.names) != 1: + raise ValueError("Can't categorical encode multiple list columns") + return has_lists + + +def _maybe_flatten_list_column(col: str, df): + # Flatten the specified column (col) if it is + # a list dtype. Otherwise, pass back df "as is" + selector = ColumnSelector([col]) + if is_list_col(selector, df): + return dispatch.flatten_list_column(df[selector.names[0]]) + return df + + +def _hash_bucket(df, num_buckets, col, encode_type="joint"): + if encode_type == "joint": + nb = num_buckets[col[0]] + encoded = dispatch.hash_series(df[col[0]]) % nb + elif encode_type == "combo": + if len(col) > 1: + name = _make_name(*tuple(col), sep="_") + else: + name = col[0] + nb = num_buckets[name] + val = 0 + for column in col: + val ^= dispatch.hash_series(df[column]) # or however we want to do this aggregation + val = val % nb + encoded = val + return encoded + + +def _copy_storage(existing_stats, existing_path, new_path, copy): + """helper function to copy files to a new storage location""" + existing_fs = get_fs_token_paths(existing_path)[0] + new_fs = get_fs_token_paths(new_path)[0] + new_locations = {} + + for column, existing_file in existing_stats.items(): + new_file = existing_file.replace(str(existing_path), str(new_path)) + if copy and new_file != existing_file: + new_fs.makedirs(os.path.dirname(new_file), exist_ok=True) + + # For some ops, the existing "file" is a directory containing `part.N.parquet` files. + # In that case, new_file is actually a directory and we will iterate through the "part" + # files and copy them individually + if os.path.isdir(existing_file): + new_fs.makedirs(new_file, exist_ok=True) + for existing_file_part in existing_fs.ls(existing_file): + new_file_part = os.path.join(new_file, os.path.basename(existing_file_part)) + with new_fs.open(new_file_part, "wb") as output: + output.write(existing_fs.open(existing_file_part, "rb").read()) + else: + with new_fs.open(new_file, "wb") as output: + output.write(existing_fs.open(existing_file, "rb").read()) + + new_locations[column] = new_file + + return new_locations + + +def _reset_df_index(col_name, cat_file_path, idx_count): + cat_df = _compute_sync(dispatch.read_dispatch(collection=True)(cat_file_path)) + # change indexes for category + cat_df.index = cat_df.index + idx_count + # update count + idx_count += cat_df.shape[0] + # save the new indexes in file + new_cat_file_path = _save_encodings( + cat_df, + Path(cat_file_path).parent, + col_name, + preserve_index=True, + ) + return idx_count, new_cat_file_path + + +def _deprecate_tree_width(tree_width): + # Warn user if tree_width is specified + if tree_width is not None: + warnings.warn( + "The tree_width argument is now deprecated, and will be ignored. " + "Please use split_out and split_every.", + FutureWarning, + ) + + +def _compute_sync(collection): + # Simple utility to compute a dask collection with + # a synchronous scheduler (and to catch warnings + # that are intended for users doing this by accident) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", message="Running on a single-machine scheduler.*") + return collection.compute(scheduler="synchronous") +
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/clip.html b/review/pr-1877/_modules/nvtabular/ops/clip.html new file mode 100644 index 00000000000..4c191f6f343 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/clip.html @@ -0,0 +1,491 @@ + + + + + + + + + + + nvtabular.ops.clip — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.clip

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+
+from merlin.core.dispatch import DataFrameType, annotate
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class Clip(Operator): + """ + This operation clips continuous values so that they are within a min/max bound. + For instance by setting the min value to 0, you can replace all negative values with 0. + This is helpful in cases where you want to log normalize values:: + + # clip all continuous columns to be positive only, and then take the log of the clipped + # columns + columns = ColumnSelector(CONT_NAMES) >> Clip(min_value=0) >> LogOp() + + Parameters + ---------- + min_value : float, default None + The minimum value to clip values to: values less than this will be replaced with + this value. Specifying ``None`` means don't apply a minimum threshold. + max_value : float, default None + The maximum value to clip values to: values greater than this will be replaced with + this value. Specifying ``None`` means don't apply a maximum threshold. + """ + +
[docs] def __init__(self, min_value=None, max_value=None): + if min_value is None and max_value is None: + raise ValueError("Must specify a min or max value to clip to") + super().__init__() + self.min_value = min_value + self.max_value = max_value
+ +
[docs] @annotate("Clip_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + z_df = df[col_selector.names] + if self.min_value is not None: + z_df[z_df < self.min_value] = self.min_value + if self.max_value is not None: + z_df[z_df > self.max_value] = self.max_value + return z_df
+ + transform.__doc__ = Operator.transform.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/column_similarity.html b/review/pr-1877/_modules/nvtabular/ops/column_similarity.html new file mode 100644 index 00000000000..5c129f1b4e8 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/column_similarity.html @@ -0,0 +1,717 @@ + + + + + + + + + + + nvtabular.ops.column_similarity — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.column_similarity

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import numba
+import pandas as pd
+import scipy.sparse
+
+from merlin.core.compat import cuda, cupy, numpy
+from merlin.core.dispatch import DataFrameType, annotate
+from merlin.schema import Schema, Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+if cupy:
+    from cupyx.scipy.sparse import coo_matrix
+else:
+    from scipy.sparse import coo_matrix
+
+
+
[docs]class ColumnSimilarity(Operator): + """Calculates the similarity between two columns using tf-idf, cosine or + inner product as the distance metric. For each row, this calculates the distance + between the two columns by looking up features for those columns in a sparse matrix, + and then computing the distance between the rows of the feature matrices. + + Example usage:: + + # Read in the 'document_categories' file from the kaggle outbrains dataset and convert + # to a sparse matrix + df = cudf.read_csv("document_categories.csv.zip") + categories = cupyx.scipy.sparse.coo_matrix((cupy.ones(len(df)), + (df.document_id.values, df.category_id.values)) + # compute a new column 'document_id_document_id_promo_sim' between the document_id and + # document_id_promo columns on tfidf distance on the categories matrix we just loaded up + sim_features = [["document_id", "document_id_promo"]] >> ColumnSimilarity(categories, + metric='tfidf', on_device=False) + workflow = nvt.Workflow(sim_features) + + Parameters + ----------- + left_features : csr_matrix + Sparse feature matrix for the left column + right_features : csr_matrix, optional + Sparse feature matrix for the right column in each pair. If not given will use the + same feature matrix as for the left (for example when calculating document-document + distances) + on_device : bool + Whether to compute on the GPU or CPU. Computing on the GPU will be + faster, but requires that the left_features/right_features sparse matrices + fit into GPU memory. + """ + +
[docs] def __init__(self, left_features, right_features=None, metric="tfidf", on_device=True): + super(ColumnSimilarity, self).__init__() + + self.metric = metric + self.left_features = left_features + self.right_features = right_features + self.on_device = on_device + self._initialized = False
+ + def _initialize_features(self): + if not self._initialized: + self.left_features = _convert_features(self.left_features, self.metric, self.on_device) + self.right_features = ( + _convert_features(self.right_features, self.metric, self.on_device) + if self.right_features is not None + else self.left_features.copy() + ) + self._initialized = True + +
[docs] @annotate("ColumnSimilarity_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + use_values = self.on_device + if isinstance(df, pd.DataFrame): + # Disallow on-device computation for cpu-backed data + self.on_device = False + use_values = True + + # Check if features are initialized + self._initialize_features() + + names = self.output_column_names(col_selector).names + for name, (left, right) in zip(names, col_selector.grouped_names): + a = df[left].values if use_values else df[left].values_host + b = df[right].values if use_values else df[right].values_host + + if len(a) and len(b): + similarities = row_wise_inner_product( + a, self.left_features, b, self.right_features, self.on_device + ) + else: + similarities = [] + df[name] = similarities + + return df
+ + transform.__doc__ = Operator.transform.__doc__ + +
[docs] def compute_selector( + self, + input_schema: Schema, + selector: ColumnSelector, + parents_selector: ColumnSelector, + dependencies_selector: ColumnSelector, + ) -> ColumnSelector: + self._validate_matching_cols(input_schema, parents_selector, "computing input selector") + return parents_selector
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + for group in col_selector.grouped_names: + a, b = group + col_name = f"{a}_{b}_sim" + column_mapping[col_name] = [a, b] + return column_mapping
+ + @property + def output_tags(self): + return [Tags.CONTINUOUS] + + @property + def output_dtype(self): + return float
+ + +def row_wise_inner_product(a, a_features, b, b_features, on_device=True): + """Computes the similarity between two columns, by computing the inner product + along two sparse feature matrices . Both a_features and b_features are + required to be in canonical CSR format. + + Parameters + ----------- + a : array of int + Array of rowids to use in looking up a_features + a_features: CSR matrix + Sparse feature matrix + b : array of int + Array of rowids to use in looking up in b_features + b_features: CSR matrix + Sparse feature matrix + on_device: bool + Whether to compute on the GPU or CPU. Computing on the GPU will be + faster, but requires that the a_features/b_features sparse matrices + fit into GPU memory. + """ + # run a JIT compiled version of this either on gpu/cpu with numba. + # note that numba doesn't handle sparse matrix types, so we're splitting + # out to the relevant cupy/numpy arrays for indptr/indices/data + if on_device: + threadsperblock = 32 + blockspergrid = (a.size + (threadsperblock - 1)) // threadsperblock + output = cupy.zeros(len(a), dtype=a_features.data.dtype) + _row_wise_inner_product_gpu[blockspergrid, threadsperblock]( + a, + a_features.indptr, + a_features.indices, + a_features.data, + b, + b_features.indptr, + b_features.indices, + b_features.data, + output, + ) + else: + output = numpy.zeros(len(a), dtype=a_features.data.dtype) + _row_wise_inner_product_cpu( + a, + a_features.indptr, + a_features.indices, + a_features.data, + b, + b_features.indptr, + b_features.indices, + b_features.data, + output, + ) + + return output + + +@numba.njit(parallel=True) +def _row_wise_inner_product_cpu( + a, a_indptr, a_indices, a_data, b, b_indptr, b_indices, b_data, output +): + # https://github.com/PyCQA/pylint/issues/2910 + # pylint: disable=not-an-iterable + for i in numba.prange(len(a)): + output[i] = _inner_product_cpu( + a[i], a_indptr, a_indices, a_data, b[i], b_indptr, b_indices, b_data + ) + + +if cuda: + + @numba.cuda.jit + def _row_wise_inner_product_gpu( + a, a_indptr, a_indices, a_data, b, b_indptr, b_indices, b_data, output + ): + i = numba.cuda.grid(1) + if i < a.size: + output[i] = _inner_product_gpu( + a[i], a_indptr, a_indices, a_data, b[i], b_indptr, b_indices, b_data + ) + + +def _inner_product(a, a_indptr, a_indices, a_data, b, b_indptr, b_indices, b_data): + # adapted from scipy: + # https://github.com/scipy/scipy/blob/312b706c1d98980ed140adae943d41f9f7dc08f5/scipy/sparse/sparsetools/csr.h#L780-L854 + a_pos, a_end = a_indptr[a], a_indptr[a + 1] + b_pos, b_end = b_indptr[b], b_indptr[b + 1] + similarity = 0.0 + + while a_pos < a_end and b_pos < b_end: + a_j = a_indices[a_pos] + b_j = b_indices[b_pos] + if a_j == b_j: + similarity += a_data[a_pos] * b_data[b_pos] + a_pos += 1 + b_pos += 1 + elif a_j < b_j: + a_pos += 1 + else: + b_pos += 1 + + return similarity + + +# JIT the _inner_product function to run on both CPU/GPU using numba +_inner_product_cpu = numba.njit(inline="always")(_inner_product) +_inner_product_gpu = numba.cuda.jit(device=True, inline=True)(_inner_product) if cuda else None + + +def _convert_features(features, metric, on_device): + if on_device: + # take a shallow copy to avoid mutating the input, but keep gpu + # memory as low as possible. (also convert to coo_matrix if passed + # a CSR etc) + features = coo_matrix(features) + else: + if not isinstance(features, scipy.sparse.coo_matrix): + # convert to host first if the sparse matrix is on the device + if features.__class__.__module__.startswith("cupy"): + features = features.get() + # make sure we're a coo matrix + if not isinstance(features, scipy.sparse.coo_matrix): + features = scipy.sparse.coo_matrix(features) + + # Normalizes the matrix so that we can compute the distance metric + # with only the inner product + np = cupy if on_device else numpy + if metric == "tfidf": + features = _normalize(_tfidf_weight(features.copy(), np), np) + elif metric == "cosine": + features = _normalize(features.copy(), np) + elif metric != "inner": + raise ValueError(f"unknown distance metric {metric}") + + # we need features in CSR format to do the row lookup + return features.tocsr() + + +def _tfidf_weight(X, np): + N = float(X.shape[0]) + idf = np.log(N / np.bincount(X.col)) + X.data = X.data * idf[X.col] + return X + + +def _normalize(X, np): + X.data = X.data / np.sqrt(np.bincount(X.row, X.data**2))[X.row] + return X +
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/difference_lag.html b/review/pr-1877/_modules/nvtabular/ops/difference_lag.html new file mode 100644 index 00000000000..690d407d403 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/difference_lag.html @@ -0,0 +1,539 @@ + + + + + + + + + + + nvtabular.ops.difference_lag — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.difference_lag

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import numpy
+
+from merlin.core.dispatch import DataFrameType, annotate, is_dataframe_object
+from merlin.schema import Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class DifferenceLag(Operator): + """Calculates the difference between two consecutive rows of the dataset. For instance, this + operator can calculate the time since a user last had another interaction. + + This requires a dataset partitioned by one set of columns (userid) and sorted further by another + set (userid, timestamp). The dataset must already be partitioned and sorted before being passed + to the workflow. This can be easily done using dask-cudf:: + + # get a nvt dataset and convert to a dask dataframe + ddf = nvtabular.Dataset(PATHS).to_ddf() + + # partition the dask dataframe by userid, then sort by userid/timestamp + ddf = ddf.shuffle("userid").sort_values(["userid", "timestamp"]) + + # create a new nvtabular dataset on the partitioned/sorted values + dataset = nvtabular.Dataset(ddf) + + Once passed an appropriate dataset, this operator can be used to create a workflow to + compute the lagged difference within a partition:: + + # compute the delta in timestamp for each users session + diff_features = ["quantity"] >> ops.DifferenceLag(partition_cols=["userid"], shift=[1, -1]) + processor = nvtabular.Workflow(diff_features) + + Parameters + ----------- + partition_cols : str or list of str + Column or Columns that are used to partition the data. + shift : int, default 1 + The number of rows to look backwards when computing the difference lag. Negative values + indicate the number of rows to look forwards, making this compute the lead instead of lag. + """ + +
[docs] def __init__(self, partition_cols, shift=1): + super(DifferenceLag, self).__init__() + + if isinstance(partition_cols, str): + partition_cols = [partition_cols] + + self.partition_cols = partition_cols + self.shifts = [shift] if isinstance(shift, int) else shift
+ +
[docs] @annotate("DifferenceLag_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + # compute a mask indicating partition boundaries, handling multiple partition_cols + # represent partition boundaries by None values + output = {} + for shift in self.shifts: + mask = df[self.partition_cols] == df[self.partition_cols].shift(shift) + if is_dataframe_object(mask): + mask = mask.fillna(False).all(axis=1) + mask[mask == False] = None # noqa pylint: disable=singleton-comparison + + for col in col_selector.names: + name = self._column_name(col, shift) + output[name] = (df[col] - df[col].shift(shift)) * mask + output[name] = output[name].astype(self.output_dtype) + return type(df)(output)
+ + transform.__doc__ = Operator.transform.__doc__ + + @property + def dependencies(self): + return self.partition_cols + +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + for col in col_selector.names: + for shift in self.shifts: + output_col_name = self._column_name(col, shift) + column_mapping[output_col_name] = [col] + return column_mapping
+ + @property + def output_tags(self): + return [Tags.CONTINUOUS] + + @property + def output_dtype(self): + return numpy.float32 + + def _column_name(self, col, shift): + return f"{col}_difference_lag_{shift}"
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/drop_low_cardinality.html b/review/pr-1877/_modules/nvtabular/ops/drop_low_cardinality.html new file mode 100644 index 00000000000..d3c3891c03b --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/drop_low_cardinality.html @@ -0,0 +1,523 @@ + + + + + + + + + + + nvtabular.ops.drop_low_cardinality — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.drop_low_cardinality

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+from merlin.core.dispatch import DataFrameType
+from merlin.schema import Schema, Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class DropLowCardinality(Operator): + """ + DropLowCardinality drops low cardinality categorical columns. This requires the + cardinality of these columns to be known in the schema - for instance by + first encoding these columns using Categorify. + """ + +
[docs] def __init__(self, min_cardinality=4): + super().__init__() + self.min_cardinality = min_cardinality
+ +
[docs] def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + """ + Selects all non-categorical columns and any categorical columns + of at least the minimum cardinality from the dataframe. + + Parameters + ---------- + col_selector : ColumnSelector + The columns to select. + df : DataFrameType + The dataframe to transform + + Returns + ------- + DataFrameType + Dataframe with only the selected columns. + """ + return super()._get_columns(df, col_selector)
+ +
[docs] def compute_selector( + self, + input_schema: Schema, + selector: ColumnSelector, + parents_selector: ColumnSelector, + dependencies_selector: ColumnSelector, + ) -> ColumnSelector: + """ + Checks the cardinality of the input columns and drops any categorical + columns with cardinality less than the specified minimum. + + Parameters + ---------- + input_schema : Schema + The current node's input schema + selector : ColumnSelector + The current node's selector + parents_selector : ColumnSelector + A selector for the output columns of the current node's parents + dependencies_selector : ColumnSelector + A selector for the output columns of the current node's dependencies + + Returns + ------- + ColumnSelector + Selector that contains all non-categorical columns and any categorical columns + of at least the minimum cardinality. + """ + self._validate_matching_cols(input_schema, selector, self.compute_selector.__name__) + + cols_to_keep = [col for col in input_schema if Tags.CATEGORICAL not in col.tags] + + for col in input_schema: + if Tags.CATEGORICAL in col.tags: + domain = col.int_domain + if not domain or domain.max >= self.min_cardinality: + cols_to_keep.append(col.name) + + return ColumnSelector(cols_to_keep)
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/dropna.html b/review/pr-1877/_modules/nvtabular/ops/dropna.html new file mode 100644 index 00000000000..19c472e724c --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/dropna.html @@ -0,0 +1,473 @@ + + + + + + + + + + + nvtabular.ops.dropna — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.dropna

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+
+from merlin.core.dispatch import DataFrameType, annotate
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class Dropna(Operator): + """ + This operation detects and filters out rows with missing values. + + Example usage:: + + # Use Dropna to define a NVTabular workflow + # Default is None and will check all columns + dropna_features = ['cat1', 'num1'] >> ops.Dropna() >> ... + processor = nvtabular.Workflow(dropna_features) + """ + +
[docs] @annotate("Dropna_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + new_df = df.dropna(subset=col_selector.names or None) + new_df.reset_index(drop=True, inplace=True) + return new_df
+ + transform.__doc__ = Operator.transform.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/fill.html b/review/pr-1877/_modules/nvtabular/ops/fill.html new file mode 100644 index 00000000000..fea0e6c4eeb --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/fill.html @@ -0,0 +1,580 @@ + + + + + + + + + + + nvtabular.ops.fill — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.fill

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import dask.dataframe as dd
+
+from merlin.core.dispatch import DataFrameType, annotate
+from merlin.dag.ops.stat_operator import StatOperator
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class FillMissing(Operator): + """ + This operation replaces missing values with a constant pre-defined value + + Example usage:: + + # Use FillMissing to define a workflow for continuous columns and specify the fill value + # Default is 0 + cont_features = ['cont1', 'cont2', 'cont3'] >> ops.FillMissing() >> ... + processor = nvtabular.Workflow(cont_features) + + Parameters + ----------- + fill_val : float, default 0 + The constant value to replace missing values with. + add_binary_cols : boolean, default False + When True, adds binary columns that indicate whether cells in each column were filled + """ + +
[docs] def __init__(self, fill_val=0, add_binary_cols=False): + super().__init__() + self.fill_val = fill_val + self.add_binary_cols = add_binary_cols + self._inference_transform = None
+ +
[docs] @annotate("FillMissing_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + if self.add_binary_cols: + for col in col_selector.names: + df[f"{col}_filled"] = df[col].isna() + df[col] = df[col].fillna(self.fill_val) + else: + df[col_selector.names] = df[col_selector.names].fillna(self.fill_val) + + return df
+ +
[docs] def inference_initialize(self, col_selector, inference_config): + """load up extra configuration about this op.""" + if self.add_binary_cols: + return None + import nvtabular_cpp + + return nvtabular_cpp.inference.FillTransform(self)
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = super().column_mapping(col_selector) + for col_name in col_selector.names: + if self.add_binary_cols: + column_mapping[f"{col_name}_filled"] = [col_name] + return column_mapping
+ + def _compute_dtype(self, col_schema, input_schema): + col_schema = super()._compute_dtype(col_schema, input_schema) + if col_schema.name.endswith("_filled"): + col_schema = col_schema.with_dtype(bool) + return col_schema + + transform.__doc__ = Operator.transform.__doc__
+ + +
[docs]class FillMedian(StatOperator): + """ + This operation replaces missing values with the median value for the column. + + Example usage:: + + # Use FillMedian in a workflow for continuous columns + cont_features = ['cont1', 'cont2', 'cont3'] >> ops.FillMedian() + processor = nvtabular.Workflow(cont_features) + + Parameters + ----------- + add_binary_cols : boolean, default False + When True, adds binary columns that indicate whether cells in each column were filled + """ + +
[docs] def __init__(self, add_binary_cols=False): + super().__init__() + self.add_binary_cols = add_binary_cols + self.medians = {}
+ +
[docs] @annotate("FillMedian_transform", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + if not self.medians: + raise RuntimeError("need to call 'fit' before running transform") + + for col in col_selector.names: + if self.add_binary_cols: + df[f"{col}_filled"] = df[col].isna() + df[col] = df[col].fillna(self.medians[col]) + return df
+ +
[docs] @annotate("FillMedian_fit", color="green", domain="nvt_python") + def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame): + # TODO: Use `method="tidigest"` when crick supports device + dask_stats = ddf[col_selector.names].quantile(q=0.5, method="dask") + return dask_stats
+ +
[docs] @annotate("FillMedian_finalize", color="green", domain="nvt_python") + def fit_finalize(self, dask_stats): + index = dask_stats.index + vals = index.values_host if hasattr(index, "values_host") else index.values + for col in vals: + self.medians[col] = float(dask_stats[col])
+ + transform.__doc__ = Operator.transform.__doc__ + fit.__doc__ = StatOperator.fit.__doc__ + fit_finalize.__doc__ = StatOperator.fit_finalize.__doc__ + +
[docs] def clear(self): + self.medians = {}
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = super().column_mapping(col_selector) + for col_name in col_selector.names: + if self.add_binary_cols: + column_mapping[f"{col_name}_filled"] = [col_name] + return column_mapping
+ + def _compute_dtype(self, col_schema, input_schema): + col_schema = super()._compute_dtype(col_schema, input_schema) + if col_schema.name.endswith("_filled"): + col_schema = col_schema.with_dtype(bool) + return col_schema
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/filter.html b/review/pr-1877/_modules/nvtabular/ops/filter.html new file mode 100644 index 00000000000..16f455077a6 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/filter.html @@ -0,0 +1,498 @@ + + + + + + + + + + + nvtabular.ops.filter — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.filter

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+from typing import Callable, Union
+
+from merlin.core.dispatch import (
+    DataFrameType,
+    SeriesType,
+    annotate,
+    is_dataframe_object,
+    is_series_object,
+)
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class Filter(Operator): + """ + Filters rows from the dataset. This works by taking a callable that accepts + a dataframe, and returns a dataframe with unwanted rows filtered out. + + For example to filter out all rows that have a negative value in the ``a`` column:: + + filtered = cont_names >> ops.Filter(f=lambda df: df["a"] >=0) + processor = nvtabular.Workflow(filtered) + + Parameters + ----------- + f : callable + Defines a function that takes a dataframe as an argument, and returns a new + dataframe with unwanted rows filtered out. + """ + +
[docs] def __init__(self, f: Callable[[DataFrameType], Union[DataFrameType, SeriesType]]): + super().__init__() + if f is None: + raise ValueError("f cannot be None. Filter op applies f to dataframe") + self.f = f
+ +
[docs] @annotate("Filter_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + filtered = self.f(df) + if is_dataframe_object(filtered): + new_df = filtered + elif is_series_object(filtered) and filtered.dtype == bool: + new_df = df[filtered] + else: + raise ValueError(f"Invalid output from filter op: f{filtered.__class__}") + + new_df.reset_index(drop=True, inplace=True) + return new_df
+ + transform.__doc__ = Operator.transform.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/groupby.html b/review/pr-1877/_modules/nvtabular/ops/groupby.html new file mode 100644 index 00000000000..8d423d49fa8 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/groupby.html @@ -0,0 +1,753 @@ + + + + + + + + + + + nvtabular.ops.groupby — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.groupby

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+import re
+
+import numpy
+from dask.dataframe.utils import meta_nonempty
+
+from merlin.core.dispatch import DataFrameType, annotate
+from merlin.dtypes.shape import DefaultShapes
+from merlin.schema import Schema
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class Groupby(Operator): + """Groupby Transformation + + Locally transform each partition of a Dataset with one or + more groupby aggregations. + + WARNING: This transformation does NOT move data between + partitions. Please make sure that the target Dataset object + is already shuffled by ``groupby_cols``, otherwise the + output may be incorrect. See: ``Dataset.shuffle_by_keys``. + + Example usage:: + + groupby_cols = ['user_id', 'session_id'] + dataset = dataset.shuffle_by_keys(keys=groupby_cols) + + groupby_features = [ + 'user_id', 'session_id', 'month', 'prod_id', + ] >> ops.Groupby( + groupby_cols=groupby_cols, + sort_cols=['month'], + aggs={ + 'prod_id': 'list', + 'month': ['first', 'last'], + }, + ) + processor = nvtabular.Workflow(groupby_features) + + workflow.fit(dataset) + dataset_transformed = workflow.transform(dataset) + + Parameters + ----------- + groupby_cols : str or list of str + The column names to be used as groupby keys. + WARNING: Ensure the dataset was partitioned by those + groupby keys (see above for an example). + sort_cols : str or list of str + Columns to be used to sort each partition before + groupby aggregation is performed. If this argument + is not specified, the results will not be sorted. + aggs : dict, list or str + Groupby aggregations to perform. Supported list-based + aggregations include "list", "first" & "last". Most + conventional aggregations supported by Pandas/cuDF are + also allowed (e.g. "sum", "count", "max", "mean", etc.). + name_sep : str + String separator to use for new column names. + """ + +
[docs] def __init__( + self, groupby_cols=None, sort_cols=None, aggs="list", name_sep="_", ascending=True + ): + self.groupby_cols = groupby_cols + self.sort_cols = sort_cols or [] + if isinstance(self.groupby_cols, str): + self.groupby_cols = [self.groupby_cols] + if isinstance(self.sort_cols, str): + self.sort_cols = [self.sort_cols] + self.ascending = ascending + + # Split aggregations into "conventional" aggregations + # and "list-based" aggregations. After this block, + # we will have a dictionary for each of these cases. + # We use the "__all__" key to specify aggregations + # that will be performed on all (non-key) columns. + self.list_aggs, self.conv_aggs = {}, {} + if isinstance(aggs, str): + aggs = {"__all__": [aggs]} + elif isinstance(aggs, list): + aggs = {"__all__": aggs} + for col, v in aggs.items(): + _aggs = v if isinstance(v, list) else [v] + _conv_aggs, _list_aggs = set(), set() + for _agg in _aggs: + if is_list_agg(_agg): + _list_aggs.add("list" if _agg == list else _agg) + _conv_aggs.add(list) + else: + _conv_aggs.add(_agg) + if _conv_aggs: + self.conv_aggs[col] = list(_conv_aggs) + if _list_aggs: + self.list_aggs[col] = list(_list_aggs) + + self.name_sep = name_sep + super().__init__()
+ +
[docs] @annotate("Groupby_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + # Sort if necessary + if self.sort_cols: + df = df.sort_values(self.sort_cols, ascending=self.ascending, ignore_index=True) + + # List aggregations do not work with empty data. + # Use synthetic metadata to predict output columns. + empty_df = not len(df) + + _df = meta_nonempty(df) if empty_df else df + + # Get "complete" aggregation dicts + _list_aggs, _conv_aggs = _get_agg_dicts( + self.groupby_cols, self.list_aggs, self.conv_aggs, col_selector + ) + + # Apply aggregations + new_df = _apply_aggs( + _df, + self.groupby_cols, + _list_aggs, + _conv_aggs, + name_sep=self.name_sep, + ascending=self.ascending, + ) + + if empty_df: + return new_df.iloc[:0] + return new_df
+ + transform.__doc__ = Operator.transform.__doc__ + +
[docs] def compute_output_schema( + self, input_schema: Schema, col_selector: ColumnSelector, prev_output_schema: Schema = None + ) -> Schema: + if not col_selector and hasattr(self, "target"): + col_selector = ( + ColumnSelector(self.target) if isinstance(self.target, list) else self.target + ) + return super().compute_output_schema(input_schema, col_selector, prev_output_schema)
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + + for groupby_col in self.groupby_cols: + if groupby_col in col_selector.names: + column_mapping[groupby_col] = [groupby_col] + + _list_aggs, _conv_aggs = _get_agg_dicts( + self.groupby_cols, self.list_aggs, self.conv_aggs, col_selector + ) + + for input_col_name, aggs in _list_aggs.items(): + output_col_names = _columns_out_from_aggs( + {input_col_name: aggs}, name_sep=self.name_sep + ) + for output_col_name in output_col_names: + column_mapping[output_col_name] = [input_col_name] + + for input_col_name, aggs in _conv_aggs.items(): + output_col_names = _columns_out_from_aggs( + {input_col_name: aggs}, name_sep=self.name_sep + ) + for output_col_name in output_col_names: + column_mapping[output_col_name] = [input_col_name] + + return column_mapping
+ + @property + def dependencies(self): + return self.groupby_cols + + def _compute_dtype(self, col_schema, input_schema): + col_schema = super()._compute_dtype(col_schema, input_schema) + + agg_dtypes = { + "count": numpy.int32, + "nunique": numpy.int32, + "mean": numpy.float32, + "var": numpy.float32, + "std": numpy.float32, + "median": numpy.float32, + "sum": numpy.float32, + } + + agg = self._find_agg(col_schema, input_schema) + dtype = agg_dtypes.get(agg, col_schema.dtype) + + return col_schema.with_dtype(dtype) + + def _compute_shape(self, col_schema, input_schema): + agg_is_lists = {"list": True} + + agg = self._find_agg(col_schema, input_schema) + is_list = agg_is_lists.get(agg, col_schema.is_list) + + shape = DefaultShapes.LIST if is_list else DefaultShapes.SCALAR + return col_schema.with_shape(shape) + + def _find_agg(self, col_schema, input_schema): + input_selector = ColumnSelector(input_schema.column_names) + column_mapping = self.column_mapping(input_selector) + input_column_name = column_mapping[col_schema.name][0] + agg = col_schema.name.replace(input_column_name, "").lstrip(self.name_sep) + return agg
+ + +def _aggs_for_column(col_name, agg_dict): + return agg_dict.get(col_name, []) + agg_dict.get("__all__", []) + + +def _columns_out_from_aggs(aggs, name_sep="_"): + # Helper function for `output_column_names` + _agg_cols = [] + for k, v in aggs.items(): + for _v in v: + if isinstance(_v, str): + _agg_cols.append(name_sep.join([k, _v])) + return _agg_cols + + +def _apply_aggs(_df, groupby_cols, _list_aggs, _conv_aggs, name_sep="_", ascending=True): + # Apply conventional aggs + _columns = list(set(groupby_cols) | set(_conv_aggs) | set(_list_aggs)) + df = _df[_columns].groupby(groupby_cols).agg(_conv_aggs).reset_index() + + df.columns = [ + name_sep.join([n for n in name if n != ""]) for name in df.columns.to_flat_index() + ] + + # Handle custom aggs (e.g. "first" and "last") + for col, aggs in _list_aggs.items(): + for _agg in aggs: + if is_list_agg(_agg, custom=True): + df[f"{col}{name_sep}{_agg}"] = _first_or_last( + df[f"{col}{name_sep}list"], _agg, ascending=ascending + ) + if "list" not in aggs: + df.drop(columns=[col + f"{name_sep}list"], inplace=True) + + for col in df.columns: + if re.search(f"{name_sep}(count|nunique)$", col): + df[col] = df[col].astype(numpy.int32) + elif re.search(f"{name_sep}(mean|median|std|var|sum)$", col): + df[col] = df[col].astype(numpy.float32) + + return df + + +def _get_agg_dicts(groupby_cols, list_aggs, conv_aggs, columns): + # Get updated aggregation dicts. This should map "__all__" + # to specific columns, and remove elements that are not + # in `columns`. + _allowed_cols = [c for c in columns.names if c not in groupby_cols] + _list_aggs = _ensure_agg_dict(list_aggs, _allowed_cols) + _conv_aggs = _ensure_agg_dict(conv_aggs, _allowed_cols) + return _list_aggs, _conv_aggs + + +def _ensure_agg_dict(_aggs, _allowed_cols): + # Make sure aggregation dict has legal keys + if "__all__" in _aggs: + return {col: _aggs["__all__"] for col in _allowed_cols} + else: + return {k: v for k, v in _aggs.items() if k in _allowed_cols} + + +def is_list_agg(agg, custom=False): + # check if `agg` is a supported list aggregation + if custom: + return agg in ("first", "last") + else: + return agg in ("list", list, "first", "last") + + +def _first_or_last(x, kind, ascending=True): + # Redirect to _first or _last + if kind == "first" and ascending: + return _first(x) + elif kind == "last" and not ascending: + return _first(x) + else: + return _last(x) + + +def _first(x): + # Convert each element of a list column to be the first + # item in the list + if hasattr(x, "list"): + # cuDF-specific behavior + return x.list.get(0) + else: + # cpu/pandas + return x.apply(lambda y: y[0]) + + +def _last(x): + # Convert each element of a list column to be the last + # item in the list + if hasattr(x, "list"): + # cuDF-specific behavior + return x.list.get(-1) + else: + # cpu/pandas + return x.apply(lambda y: y[-1]) +
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/hash_bucket.html b/review/pr-1877/_modules/nvtabular/ops/hash_bucket.html new file mode 100644 index 00000000000..999d85bbfe9 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/hash_bucket.html @@ -0,0 +1,565 @@ + + + + + + + + + + + nvtabular.ops.hash_bucket — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.hash_bucket

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+from typing import Dict, Union
+
+import numpy
+
+from merlin.core.dispatch import (
+    DataFrameType,
+    annotate,
+    encode_list_column,
+    hash_series,
+    is_list_dtype,
+)
+from merlin.schema import Tags
+from nvtabular.ops.categorify import _emb_sz_rule
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class HashBucket(Operator): + """ + This op maps categorical columns to a contiguous integer range by first + hashing the column, then reducing modulo the number of buckets. + + Example usage:: + + cat_names = ["feature_a", "feature_b"] + + # this will hash both features a and b to 100 buckets + hash_features = cat_names >> ops.HashBucket({"feature_a": 100, "feature_b": 50}) + processor = nvtabular.Workflow(hash_features) + + + The output of this op would be:: + + feature_a feature_b + 0 90 11 + 1 70 40 + 2 52 9 + + If you would like to do frequency capping or frequency hashing, + you should use Categorify op instead. See + `Categorify op <https://github.com/NVIDIA/NVTabular/blob/stable/nvtabular/ops/categorify.py>`_ + for example usage. + + + Parameters + ---------- + num_buckets : int or dictionary:{column: num_hash_buckets} + Column-wise modulo to apply after hash function. Note that this + means that the corresponding value will be the categorical cardinality + of the transformed categorical feature. If given as an int, that value + will be used as the number of "hash buckets" for every feature. + If a dictionary is passed, it will be used to specify + explicit mappings from a column name to a number of buckets. In + this case, only the columns specified in the keys of `num_buckets` + will be transformed. + """ + +
[docs] def __init__(self, num_buckets: Union[int, Dict[str, int]]): + if isinstance(num_buckets, dict): + self.num_buckets = num_buckets + elif isinstance(num_buckets, int): + self.num_buckets = num_buckets + else: + raise TypeError( + "`num_buckets` must be dict, iterable, or int, got type {}".format( + type(num_buckets) + ) + ) + super(HashBucket, self).__init__()
+ +
[docs] @annotate("HashBucket_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + if isinstance(self.num_buckets, int): + num_buckets = {name: self.num_buckets for name in col_selector.names} + else: + num_buckets = self.num_buckets + + for col, nb in num_buckets.items(): + if is_list_dtype(df[col].dtype): + df[col] = encode_list_column( + df[col], hash_series(df[col]) % nb, dtype=self.output_dtype + ) + else: + df[col] = (hash_series(df[col]) % nb).astype(self.output_dtype) + + return df
+ + transform.__doc__ = Operator.transform.__doc__ + +
[docs] def get_embedding_sizes(self, columns): + if isinstance(self.num_buckets, int): + embedding_size = _emb_sz_rule(self.num_buckets) + return {col: embedding_size for col in columns} + else: + return {col: _emb_sz_rule(self.num_buckets[col]) for col in columns}
+ + def _compute_properties(self, col_schema, input_schema): + source_col_name = input_schema.column_names[0] + + cardinality, dimensions = self.get_embedding_sizes([col_schema.name])[col_schema.name] + + to_add = {} + if cardinality and dimensions: + to_add = { + "domain": {"min": 0, "max": cardinality}, + "embedding_sizes": {"cardinality": cardinality, "dimension": dimensions}, + } + + return col_schema.with_properties({**input_schema[source_col_name].properties, **to_add}) + + @property + def output_tags(self): + return [Tags.CATEGORICAL] + + @property + def output_dtype(self): + return numpy.int32
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/hashed_cross.html b/review/pr-1877/_modules/nvtabular/ops/hashed_cross.html new file mode 100644 index 00000000000..3088bd1dae0 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/hashed_cross.html @@ -0,0 +1,525 @@ + + + + + + + + + + + nvtabular.ops.hashed_cross — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.hashed_cross

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+
+from typing import Dict, Union
+
+import numpy
+
+from merlin.core.dispatch import DataFrameType, annotate, hash_series
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class HashedCross(Operator): + """ + This ops creates hashed cross columns by first combining categorical features + and hashing the combined feature, then reducing modulo the number of buckets. + + Example usage:: + + # Define parameters + cat_names = [["name-string", "id"]] + num_buckets = 10 + + # Use HashedCross operator to define NVTabular workflow + hashed_cross = cat_names >> ops.HashedCross(num_buckets) + processor = nvtabular.Workflow(hashed_cross) + + Parameters + ---------- + num_buckets : int or dict + Column-wise modulo to apply after hash function. Note that this + means that the corresponding value will be the categorical cardinality + of the transformed categorical feature. That value will be used as the + number of "hash buckets" for every output feature. + """ + +
[docs] def __init__(self, num_buckets: Union[int, Dict[str, int]]): + super().__init__() + if not isinstance(num_buckets, (int, dict)): + raise ValueError(f"num_buckets should be an int or dict, found {num_buckets.__class__}") + + self.num_buckets = num_buckets
+ +
[docs] @annotate("HashedCross_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + new_df = type(df)() + for cross in _nest_columns(col_selector.names): + val = 0 + for column in cross: + val = hash_series(df[column]) ^ val # or however we want to do this aggregation + if isinstance(self.num_buckets, dict): + val = val % self.num_buckets[cross] + else: + val = val % self.num_buckets + new_df["_X_".join(cross)] = val.astype(self.output_dtype) + return new_df
+ + transform.__doc__ = Operator.transform.__doc__ + +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + for cross in _nest_columns(col_selector): + output_col = "_X_".join(cross) + column_mapping[output_col] = [*cross] + + return column_mapping
+ + @property + def output_dtype(self): + return numpy.int32
+ + +def _nest_columns(columns): + # if we have a list of flat column names, lets cross the whole group + if isinstance(columns, ColumnSelector): + columns = columns.names + if all(isinstance(col, str) for col in columns): + return [tuple(columns)] + else: + return columns +
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/join_external.html b/review/pr-1877/_modules/nvtabular/ops/join_external.html new file mode 100644 index 00000000000..a5d7a2e68d1 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/join_external.html @@ -0,0 +1,655 @@ + + + + + + + + + + + nvtabular.ops.join_external — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.join_external

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import warnings
+
+import dask.dataframe as dd
+import pandas as pd
+
+from merlin.core.compat import cudf
+from merlin.core.dispatch import (
+    DataFrameType,
+    ExtData,
+    arange,
+    convert_data,
+    create_merlin_dataset,
+    detect_format,
+    to_host,
+)
+from merlin.schema import Schema
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class JoinExternal(Operator): + """ + Join each dataset partition to an external table. For performance + reasons, only "left" and "inner" join transformations are supported. + + Example usage:: + + # Load dataset which should be joined to the main dataset + df_external = cudf.read_parquet('external.parquet') + + # Use JoinExternal to define a NVTabular workflow + joined = ColumnSelector(columns_left) >> nvt.ops.JoinExternal( + df_ext, + on=['key1', 'key2'], + on_ext=['key1_ext', 'key2_ext'], + how='left', + columns_ext=['key1_ext', 'key2_ext', 'cat1', 'cat2', 'num1'], + kind_ext='cudf', + cache='device' + ) >> ... + processor = nvtabular.Workflow(joined) + + Parameters + ----------- + df_ext : DataFrame, pyarrow.Table, Dataset, dd.DataFrame, or file path(s) + The external table to join to each partition of the dataset. Note + that the join must be a partition-wise transformation. Therefore, + if ``df_ext`` is a multi-partition Dask collection, it will need to + be broadcasted to every partition. + on : str or list(str) + Column name(s) to merge on + how : {"left", "inner"}; default "left" + Type of join operation to perform. + on_ext : str or list(str); Optional + Column name(s) on external table to join on. By default, + we assume ``on_ext`` is the same as ``on``. + columns_ext : list(str); Optional + Subset of columns to select from external table before join. + drop_duplicates_ext : bool; Default False + Drop duplicates from external table before join. + kind_ext : ExtData; Optional + Format of ``df_ext``. If nothing is specified, the format + will be inferred. + cache : {"device", "host", "disk"} + Where to cache ``df_ext`` between transformations. Only used + if the data is originally stored on disk. The "host" option + is also supported when ``df_ext`` is a ``cudf.DataFrame``. + """ + +
[docs] def __init__( + self, + df_ext, + on, + how="left", + on_ext=None, + columns_ext=None, + drop_duplicates_ext=None, + kind_ext=None, + cache="host", + **kwargs, + ): + super(JoinExternal).__init__() + self.on = on + self.df_ext = create_merlin_dataset(df_ext) + self.on_ext = on_ext or self.on + self.how = how + self.kind_ext = kind_ext or detect_format(self.df_ext) + self.columns_ext = columns_ext + self.drop_duplicates_ext = drop_duplicates_ext + self.cache = cache + self.kwargs = kwargs + self.cpu = None + self._ext_cache = None + if cudf is None: + self.cpu = True + if self.how not in ("left", "inner"): + raise ValueError("Only left join is currently supported.") + if not isinstance(self.kind_ext, ExtData): + raise ValueError("kind_ext option not recognized.") + super().__init__()
+ + @property + def _ext(self): + if self._ext_cache is not None: + # Return cached result if present + return convert_data(self._ext_cache, cpu=self.cpu) + + # Use Dataset.to_ddf + _dataset = self.df_ext + if self.cpu: + _dataset.to_cpu() + else: + _dataset.to_gpu() + _ext = _check_partition_count(_dataset.to_ddf(columns=self.columns_ext)) + + # Take subset of columns if a list is specified + if self.columns_ext: + _ext = _ext[self.columns_ext] + + # Drop duplicates if requested + if self.drop_duplicates_ext: + if isinstance(_ext, dd.DataFrame): + _ext = _ext.drop_duplicates(ignore_index=True) + else: + _ext.drop_duplicates(ignore_index=True, inplace=True) + + # Cache and return + if self.cache == "host": + self._ext_cache = to_host(_ext) + elif self.cache == "device" or self.kind_ext not in (ExtData.PARQUET, ExtData.CSV): + self._ext_cache = _ext + return _ext + + def _merge(self, df, _ext): + if isinstance(_ext, dd.DataFrame): + _ddf = dd.from_pandas(df, npartitions=1) + return _ddf.merge(_ext, left_on=self.on, right_on=self.on_ext, how=self.how).compute() + else: + return df.merge(_ext, left_on=self.on, right_on=self.on_ext, how=self.how) + +
[docs] def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + self.cpu = isinstance(df, pd.DataFrame) + tmp = "__tmp__" # Temporary column for sorting + df[tmp] = arange(len(df), like_df=df, dtype="int32") + new_df = self._merge(df, self._ext) + new_df = new_df.sort_values(tmp) + new_df.drop(columns=[tmp], inplace=True) + df.drop(columns=[tmp], inplace=True) + new_df.reset_index(drop=True, inplace=True) + return new_df
+ + transform.__doc__ = Operator.transform.__doc__ + +
[docs] def compute_selector( + self, + input_schema: Schema, + selector: ColumnSelector, + parents_selector: ColumnSelector, + dependencies_selector: ColumnSelector, + ) -> ColumnSelector: + self._validate_matching_cols(input_schema, parents_selector, "computing input selector") + return parents_selector
+ +
[docs] def compute_output_schema(self, input_schema, col_selector, prev_output_schema=None): + # must load in the schema from the external dataset + input_schema = input_schema + self.df_ext.schema + return super().compute_output_schema(input_schema, col_selector, prev_output_schema)
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + ext_columns = self.columns_ext if self.columns_ext else self._ext.columns + + # This maintains the order which set() does not + combined_col_names = dict.fromkeys(col_selector.names + list(ext_columns)).keys() + + for col_name in combined_col_names: + column_mapping[col_name] = [col_name] + + return column_mapping
+ + def _compute_dtype(self, col_schema, input_schema): + if col_schema.name in input_schema.column_names: + return super()._compute_dtype(col_schema, input_schema) + else: + col_dtype = self.df_ext.schema.column_schemas[col_schema.name].dtype + return col_schema.with_dtype(col_dtype) + + def _compute_tags(self, col_schema, input_schema): + return col_schema + + def _compute_properties(self, col_schema, input_schema): + return col_schema
+ + +def _check_partition_count(df): + if hasattr(df, "npartitions"): + if df.npartitions == 1: + # Materialize single-partition collections + return df.compute() + if df.npartitions > 3: + warnings.warn( + f"Joining an external Dask collection with " + f"{df.npartitions} partitions. This transformation " + f"requires a broadcast merge, which can be problematic " + f"when the external collection is too large." + ) + return df +
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/join_groupby.html b/review/pr-1877/_modules/nvtabular/ops/join_groupby.html new file mode 100644 index 00000000000..855646acc92 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/join_groupby.html @@ -0,0 +1,717 @@ + + + + + + + + + + + nvtabular.ops.join_groupby — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.join_groupby

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import dask.dataframe as dd
+import numpy as np
+import pandas as pd
+from dask.delayed import Delayed
+
+from merlin.core.dispatch import DataFrameType, arange, concat_columns, read_parquet_dispatch
+from merlin.dag import Node
+from merlin.dag.ops.stat_operator import StatOperator
+from merlin.dtypes.shape import DefaultShapes
+from merlin.schema import Schema
+from nvtabular.ops import categorify as nvt_cat
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+AGG_DTYPES = {
+    "count": np.int32,
+    "std": np.float32,
+    "var": np.float32,
+    "mean": np.float32,
+}
+
+
+
[docs]class JoinGroupby(StatOperator): + """ + One of the ways to create new features is to calculate + the basic statistics of the data that is grouped by categorical + features. This operator groups the data by the given categorical + feature(s) and calculates the desired statistics of requested continuous + features (along with the count of rows in each group). The aggregated + statistics are merged with the data (by joining on the desired + categorical columns). + + Example usage:: + + # Use JoinGroupby to define a NVTabular workflow + groupby_features = ['cat1', 'cat2', 'cat3'] >> ops.JoinGroupby( + out_path=str(tmpdir), stats=['sum','count'], cont_cols=['num1'] + ) + processor = nvtabular.Workflow(groupby_features) + + Parameters + ----------- + cont_cols : list of str or WorkflowNode + The continuous columns to calculate statistics for + (for each unique group in each column in `columns`). + stats : list of str, default [] + List of statistics to calculate for each unique group. Note + that "count" corresponds to the group itself, while all + other statistics correspond to a specific continuous column. + Supported statistics include ["count", "sum", "mean", "std", "var"]. + split_out : dict or int, optional + Number of files needed to store the final result of each groupby + reduction. High-cardinality groups may require a large `split_out`, + while low-cardinality columns can likely use `split_out=1` (default). + If passing a dict, each key and value should correspond to the column + name and value, respectively. The default value is 1 for all columns. + split_every : dict or int, optional + Number of adjacent partitions to aggregate in each tree-reduction + node. The default value is 8 for all columns. + cat_cache: ToDo Describe + TEXT + out_path : str, optional + Root directory where groupby statistics will be written out in + parquet format. + on_host : bool, default True + Whether to convert cudf data to pandas between tasks in the hash-based + groupby reduction. The extra host <-> device data movement can reduce + performance. However, using `on_host=True` typically improves stability + (by avoiding device-level memory pressure). + name_sep : str, default "_" + String separator to use between concatenated column names + for multi-column groups. + """ + +
[docs] def __init__( + self, + cont_cols=None, + stats=("count",), + split_out=None, + split_every=None, + cat_cache="host", + out_path=None, + on_host=True, + name_sep="_", + tree_width=None, + ): + super().__init__() + + self.storage_name = {} + self.name_sep = name_sep + self.stats = stats + self.split_out = split_out + self.split_every = split_every + self.out_path = out_path or "./" + self.on_host = on_host + self.cat_cache = cat_cache + self.categories = {} + nvt_cat._deprecate_tree_width(tree_width) + + self._cont_names = None + + if isinstance(cont_cols, Node): + self.cont_cols = cont_cols + elif isinstance(cont_cols, ColumnSelector): + self.cont_cols = self._cont_names = cont_cols + else: + self.cont_cols = self._cont_names = ColumnSelector(cont_cols) + + supported_ops = ["count", "sum", "mean", "std", "var", "min", "max"] + for op in self.stats: + if op not in supported_ops: + raise ValueError(op + " operation is not supported.")
+ + @property + def cont_names(self): + if self._cont_names: + return self._cont_names + elif self.cont_cols.output_schema: + return self.cont_cols.output_columns + else: + raise RuntimeError( + "Can't compute continuous columns used by `JoinGroupby` " + "until `Workflow` is fit to dataset or schema." + ) + +
[docs] def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame): + for group in col_selector.subgroups: + if len(group.names) > 1: + name = nvt_cat._make_name(*group.names, sep=self.name_sep) + for col in group.names: + self.storage_name[col] = name + + # Check metadata type to reset on_host and cat_cache if the + # underlying ddf is already a pandas-backed collection + if isinstance(ddf._meta, pd.DataFrame): + self.on_host = False + # Cannot use "device" caching if the data is pandas-backed + self.cat_cache = "host" if self.cat_cache == "device" else self.cat_cache + + dsk, key = nvt_cat._category_stats( + ddf, + nvt_cat.FitOptions( + col_selector, + self.cont_names, + self.stats, + self.out_path, + 0, + self.split_out, + self.on_host, + concat_groups=False, + name_sep=self.name_sep, + split_every=self.split_every, + ), + ) + return Delayed(key, dsk)
+ +
[docs] def fit_finalize(self, dask_stats): + for col in dask_stats: + self.categories[col] = dask_stats[col]
+ +
[docs] def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + new_df = type(df)() + tmp = "__tmp__" # Temporary column for sorting + df[tmp] = arange(len(df), like_df=df, dtype="int32") + + cat_names = [] + multi_col_group = {} + for col_name in col_selector.grouped_names: + if isinstance(col_name, (list, tuple)): + name = nvt_cat._make_name(*col_name, sep=self.name_sep) + if name not in cat_names and all(col in df.columns for col in col_name): + cat_names.append(name) + multi_col_group[name] = col_name + elif col_name in df.columns: + cat_names.append(col_name) + + _read_pq_func = read_parquet_dispatch(df) + for name in cat_names: + new_part = type(df)() + storage_name = self.storage_name.get(name, name) + name = multi_col_group.get(name, name) + path = self.categories[storage_name] + selection_l = list(name) if isinstance(name, tuple) else [name] + selection_r = list(name) if isinstance(name, tuple) else [storage_name] + + stat_df = nvt_cat._read_groupby_stat_df( + path, storage_name, self.cat_cache, _read_pq_func + ) + tran_df = df[selection_l + [tmp]].merge( + stat_df, left_on=selection_l, right_on=selection_r, how="left" + ) + tran_df = tran_df.sort_values(tmp) + tran_df.drop(columns=selection_l + [tmp], inplace=True) + new_cols = [c for c in tran_df.columns if c not in new_df.columns] + new_part = tran_df[new_cols].reset_index(drop=True) + for col in new_part.columns: + for agg in list(AGG_DTYPES.keys()): + if col.endswith(f"{self.name_sep}{agg}"): + new_dtype = AGG_DTYPES.get(agg, new_part[col].dtype) + new_part[col] = new_part[col].astype(new_dtype) + new_df = concat_columns([new_df, new_part]) + df.drop(columns=[tmp], inplace=True) + return new_df
+ + @property + def dependencies(self): + return self.cont_cols + +
[docs] def compute_selector( + self, + input_schema: Schema, + selector: ColumnSelector, + parents_selector: ColumnSelector, + dependencies_selector: ColumnSelector, + ) -> ColumnSelector: + self._validate_matching_cols(input_schema, parents_selector, "computing input selector") + return parents_selector
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + for group in col_selector.grouped_names: + if isinstance(group, (tuple, list)): + name = nvt_cat._make_name(*group, sep=self.name_sep) + group = [*group] + else: + name = group + group = [group] + + for cont in self.cont_names.names: + for stat in self.stats: + if stat == "count": + column_mapping[f"{name}_{stat}"] = [*group] + else: + column_mapping[f"{name}_{cont}_{stat}"] = [cont, *group] + + return column_mapping
+ + def _compute_dtype(self, col_schema, input_schema): + new_schema = super()._compute_dtype(col_schema, input_schema) + dtype = new_schema.dtype + + for agg in list(AGG_DTYPES.keys()): + if new_schema.name.endswith(f"{self.name_sep}{agg}"): + dtype = AGG_DTYPES.get(agg, dtype) + break + + return new_schema.with_dtype(dtype) + + def _compute_shape(self, col_schema, input_schema): + new_schema = super()._compute_shape(col_schema, input_schema) + shape = new_schema.shape + + agg_applied = any( + new_schema.name.endswith(f"{self.name_sep}{agg}") for agg in list(AGG_DTYPES.keys()) + ) + + return new_schema.with_shape(DefaultShapes.SCALAR if agg_applied else shape) + +
[docs] def set_storage_path(self, new_path, copy=False): + self.categories = nvt_cat._copy_storage(self.categories, self.out_path, new_path, copy) + self.out_path = new_path
+ +
[docs] def clear(self): + self.categories = {} + self.storage_name = {}
+ + transform.__doc__ = Operator.transform.__doc__ + fit.__doc__ = StatOperator.fit.__doc__ + fit_finalize.__doc__ = StatOperator.fit_finalize.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/list_slice.html b/review/pr-1877/_modules/nvtabular/ops/list_slice.html new file mode 100644 index 00000000000..ac5bf705a03 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/list_slice.html @@ -0,0 +1,662 @@ + + + + + + + + + + + nvtabular.ops.list_slice — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.list_slice

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import numba.cuda
+import numpy as np
+
+try:
+    import cupy as cp
+except ImportError:
+    cp = None
+
+from merlin.core.dispatch import DataFrameType, annotate, build_cudf_list_column, is_cpu_object
+from merlin.schema import Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class ListSlice(Operator): + """Slices a list column + + This operator provides the ability to slice list column by row. For example, to truncate a + list column to only include the first 10 elements per row:: + + truncated = column_names >> ops.ListSlice(10) + + Take the first 10 items, ignoring the first element:: + + truncated = column_names >> ops.ListSlice(1, 11) + + Take the last 10 items from each row:: + + truncated = column_names >> ops.ListSlice(-10) + + Parameters + ----------- + start: int + The starting value to slice from if end isn't given, otherwise the end value to slice to + end: int, optional + The end value to slice to + pad: bool, default False + Whether to pad out rows to have the same number of elements. If not set rows may not all + have the same number of entries. + pad_value: float + When pad=True, this is the value used to pad missing entries + """ + +
[docs] def __init__(self, start, end=None, pad=False, pad_value=0.0): + super().__init__() + self.start = start + self.end = end + self.pad = pad + self.pad_value = pad_value + + if self.start > 0 and self.end is None: + self.end = self.start + self.start = 0 + + if self.end is None: + self.end = np.iinfo(np.int64).max + + if self.start < 0: + self.max_elements = -(self.start if self.end > 0 else self.start - self.end) + else: + self.max_elements = self.end - self.start
+ +
[docs] @annotate("ListSlice_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + on_cpu = is_cpu_object(df) + ret = type(df)() + + if on_cpu: + xp = np + else: + xp = cp + + for col in col_selector.names: + # handle CPU via normal python slicing (not very efficient) + if on_cpu: + values = [row[self.start : self.end] for row in df[col]] + + # pad out to so each row has self.max_elements if asked + if self.pad: + for v in values: + if len(v) < self.max_elements: + padding = [self.pad_value] * (self.max_elements - len(v)) + if isinstance(v, xp.ndarray): + xp.append(v, padding) + else: + v.extend(padding) + + ret[col] = values + else: + # figure out the size of each row from the list offsets + c = df[col]._column + offsets = c.offsets.values + elements = c.elements.values + + threads = 32 + blocks = (offsets.size + threads - 1) // threads + + if self.pad: + new_offsets = cp.arange(offsets.size, dtype=offsets.dtype) * self.max_elements + + else: + # figure out the size of each row after slicing start/end + new_offsets = cp.zeros(offsets.size, dtype=offsets.dtype) + + # calculate new row offsets after slicing + _calculate_row_sizes[blocks, threads]( + self.start, self.end, offsets, new_offsets + ) + new_offsets = cp.cumsum(new_offsets).astype(offsets.dtype) + + # create a new array for the sliced elements + new_elements = cp.full( + new_offsets[-1].item(), + fill_value=self.pad_value, + dtype=elements.dtype, + ) + if new_elements.size: + _slice_rows[blocks, threads]( + self.start, + self.end, + offsets, + elements, + new_offsets, + new_elements, + ) + + # build up a list column with the sliced values + ret[col] = build_cudf_list_column(new_elements, new_offsets) + + return ret
+ + def _compute_dtype(self, col_schema, input_schema): + col_schema = super()._compute_dtype(col_schema, input_schema) + return col_schema.with_dtype(col_schema.dtype) + + def _compute_properties(self, col_schema, input_schema): + col_schema = super()._compute_properties(col_schema, input_schema) + properties = { + **col_schema.properties, + **{"value_count": {"min": 0, "max": None}}, + } + if self.max_elements != np.iinfo(np.int64).max: + properties["value_count"]["max"] = self.max_elements + if self.pad: + properties["value_count"]["min"] = self.max_elements + return col_schema.with_properties(properties) + + def _compute_shape(self, col_schema, input_schema): + col_schema = super()._compute_shape(col_schema, input_schema) + + min_count, max_count = (0, None) + if self.max_elements != np.iinfo(np.int64).max: + max_count = self.max_elements + if self.pad: + min_count = self.max_elements + + return col_schema.with_shape((None, (min_count, max_count))) + + @property + def output_tags(self): + return [Tags.LIST] + + transform.__doc__ = Operator.transform.__doc__
+ + +@numba.cuda.jit +def _calculate_row_sizes(start, end, offsets, row_sizes): + """given a slice (start/end) and existing offsets indicating row lengths, this + calculates the size for each new row after slicing""" + rowid = numba.cuda.grid(1) + if rowid < offsets.size - 1: + original_row_size = offsets[rowid + 1] - offsets[rowid] + + # handle negative slicing appropriately + if start < 0: + start = original_row_size + start + if end < 0: + end = original_row_size + end + + # clamp start/end to be in (0, original_row_size) + start = min(max(0, start), original_row_size) + end = min(max(0, end), original_row_size) + + row_sizes[rowid + 1] = end - start + + +@numba.cuda.jit +def _slice_rows(start, end, offsets, elements, new_offsets, new_elements): + """slices rows of a list column. requires the 'new_offsets' to + be previously calculated (meaning that we don't need the 'end' slice index + since that's baked into the new_offsets""" + rowid = numba.cuda.grid(1) + if rowid < (new_offsets.size - 1): + if start >= 0: + offset = offsets[rowid] + start + else: + offset = offsets[rowid + 1] + start + if offset < offsets[rowid]: + offset = offsets[rowid] + + new_start = new_offsets[rowid] + new_end = new_offsets[rowid + 1] + + # if we are padding (more new offsets than old offsets) - don't keep on iterating past + # the end + offset_delta = (new_end - new_start) - (offsets[rowid + 1] - offset) + if offset_delta > 0: + new_end -= offset_delta + elif offset_delta == 0 and end < 0: + new_end += end + + for new_offset in range(new_start, new_end): + new_elements[new_offset] = elements[offset] + offset += 1 +
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/logop.html b/review/pr-1877/_modules/nvtabular/ops/logop.html new file mode 100644 index 00000000000..108b6468b57 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/logop.html @@ -0,0 +1,497 @@ + + + + + + + + + + + nvtabular.ops.logop — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.logop

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import numpy as np
+
+from merlin.core.dispatch import (
+    DataFrameType,
+    annotate,
+    encode_list_column,
+    flatten_list_column_values,
+    is_list_dtype,
+)
+from merlin.schema import Tags
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class LogOp(Operator): + """ + This operator calculates the log of continuous columns. Note that + to handle the common case of zerofilling null values, this + calculates ``log(1+x)`` instead of just ``log(x)``. + + Example usage:: + + # Use LogOp to define NVTabular workflow + cont_features = cont_names >> nvt.ops.LogOp() >> ... + processor = nvt.Workflow(cont_features) + """ + +
[docs] @annotate("LogOp_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + for name in col_selector.names: + column = df[name] + if is_list_dtype(column): + transformed = np.log( + flatten_list_column_values(column).astype(self.output_dtype) + 1 + ) + df[name] = encode_list_column(column, transformed) + else: + df[name] = np.log(column.astype(self.output_dtype) + 1) + return df
+ + @property + def output_tags(self): + return [Tags.CONTINUOUS] + + @property + def output_dtype(self): + return np.float32 + + transform.__doc__ = Operator.transform.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/normalize.html b/review/pr-1877/_modules/nvtabular/ops/normalize.html new file mode 100644 index 00000000000..2a0ace3634c --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/normalize.html @@ -0,0 +1,646 @@ + + + + + + + + + + + nvtabular.ops.normalize — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.normalize

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import dask.dataframe as dd
+import numpy
+
+from merlin.core.dispatch import (
+    DataFrameType,
+    annotate,
+    encode_list_column,
+    flatten_list_column_values,
+    is_list_dtype,
+)
+from merlin.dag import DataFormats, Supports
+from merlin.dag.ops.stat_operator import StatOperator
+from merlin.schema import Tags
+from nvtabular.ops.moments import _custom_moments
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class Normalize(StatOperator): + """ + Standardizing the features around 0 with a standard deviation + of 1 is a common technique to compare measurements that have + different units. This operation can be added to the workflow + to standardize the features. + + It performs Normalization using the mean std method. + + Example usage:: + + # Use Normalize to define a NVTabular workflow + cont_features = CONTINUOUS_COLUMNS >> ops.Normalize() + processor = nvtabular.Workflow(cont_features) + + Parameters + ----------- + out_dtype : str + Specifies the data type for the output columns. The default value is `numpy.float64` if + not set here + """ + +
[docs] def __init__(self, out_dtype=None): + super().__init__() + self.means = {} + self.stds = {} + self.out_dtype = out_dtype
+ +
[docs] @annotate("Normalize_fit", color="green", domain="nvt_python") + def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame): + return _custom_moments(ddf[col_selector.names])
+ +
[docs] def fit_finalize(self, dask_stats): + for col in dask_stats.index: + self.means[col] = float(dask_stats["mean"].loc[col]) + self.stds[col] = float(dask_stats["std"].loc[col])
+ +
[docs] @annotate("Normalize_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + new_df = type(df)() + for name in col_selector.names: + values = df[name] + list_col = is_list_dtype(values) + if list_col: + values = flatten_list_column_values(values) + + if self.stds[name] > 0: + values = (values - self.means[name]) / (self.stds[name]) + else: + values = values - self.means[name] + + values = values.astype(self.output_dtype) + + if list_col: + values = encode_list_column(df[name], values) + + new_df[name] = values + return new_df
+ + @property + def supports(self): + return ( + Supports.CPU_DICT_ARRAY + | Supports.GPU_DICT_ARRAY + | Supports.CPU_DATAFRAME + | Supports.GPU_DATAFRAME + ) + + @property + def supported_formats(self): + return ( + DataFormats.PANDAS_DATAFRAME + | DataFormats.CUDF_DATAFRAME + | DataFormats.NUMPY_DICT_ARRAY + | DataFormats.CUPY_DICT_ARRAY + ) + +
[docs] def clear(self): + self.means = {} + self.stds = {}
+ + @property + def output_tags(self): + return [Tags.CONTINUOUS] + + @property + def output_dtype(self): + return self.out_dtype or numpy.float64 + + transform.__doc__ = Operator.transform.__doc__ + fit.__doc__ = StatOperator.fit.__doc__ + fit_finalize.__doc__ = StatOperator.fit_finalize.__doc__
+ + +
[docs]class NormalizeMinMax(StatOperator): + """ + This operator standardizes continuous features such that they are between 0 and 1. + + Example usage:: + + # Use NormalizeMinMax to define a NVTabular workflow + cont_features = CONTINUOUS_COLUMNS >> ops.NormalizeMinMax() + processor = nvtabular.Workflow(cont_features) + + Parameters + ----------- + out_dtype : str, default is float64 + dtype of output columns. + """ + +
[docs] def __init__(self, out_dtype=None): + super().__init__() + self.mins = {} + self.maxs = {} + self.out_dtype = out_dtype
+ +
[docs] @annotate("NormalizeMinMax_op", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType): + # TODO: should we clip values if they are out of bounds (below 0 or 1) + # (could happen in validation dataset if datapoint) + new_df = type(df)() + for name in col_selector.names: + dif = self.maxs[name] - self.mins[name] + if dif > 0: + new_df[name] = (df[name] - self.mins[name]) / dif + elif dif == 0: + new_df[name] = df[name] / (2 * df[name]) + new_df[name] = new_df[name].astype(self.output_dtype) + return new_df
+ + transform.__doc__ = Operator.transform.__doc__ + +
[docs] @annotate("NormalizeMinMax_fit", color="green", domain="nvt_python") + def fit(self, col_selector: ColumnSelector, ddf): + return { + "mins": ddf[col_selector.names].min(), + "maxs": ddf[col_selector.names].max(), + }
+ +
[docs] @annotate("NormalizeMinMax_finalize", color="green", domain="nvt_python") + def fit_finalize(self, dask_stats): + index = dask_stats["mins"].index + cols = index.values_host if hasattr(index, "values_host") else index.values + for col in cols: + self.mins[col] = dask_stats["mins"][col] + self.maxs[col] = dask_stats["maxs"][col]
+ +
[docs] def clear(self): + self.mins = {} + self.maxs = {}
+ + @property + def supports(self): + return ( + Supports.CPU_DICT_ARRAY + | Supports.GPU_DICT_ARRAY + | Supports.CPU_DATAFRAME + | Supports.GPU_DATAFRAME + ) + + @property + def supported_formats(self): + return ( + DataFormats.PANDAS_DATAFRAME + | DataFormats.CUDF_DATAFRAME + | DataFormats.NUMPY_DICT_ARRAY + | DataFormats.CUPY_DICT_ARRAY + ) + + @property + def output_tags(self): + return [Tags.CONTINUOUS] + + @property + def output_dtype(self): + return self.out_dtype or numpy.float64 + + transform.__doc__ = Operator.transform.__doc__ + fit.__doc__ = StatOperator.fit.__doc__ + fit_finalize.__doc__ = StatOperator.fit_finalize.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/reduce_dtype_size.html b/review/pr-1877/_modules/nvtabular/ops/reduce_dtype_size.html new file mode 100644 index 00000000000..9437d803e09 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/reduce_dtype_size.html @@ -0,0 +1,520 @@ + + + + + + + + + + + nvtabular.ops.reduce_dtype_size — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.reduce_dtype_size

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import dask.dataframe as dd
+import numpy as np
+
+from merlin.core.dispatch import DataFrameType, annotate
+from merlin.dag.ops.stat_operator import StatOperator
+from merlin.schema import Schema
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+_INT_DTYPES = [np.int8, np.int16, np.int32, np.int64]
+
+
+
[docs]class ReduceDtypeSize(StatOperator): + """ + ReduceDtypeSize changes the dtypes of numeric columns. For integer columns + this will choose a dtype such that the minimum and maximum values in the + column will fit. For float columns this will cast to a float32. + """ + +
[docs] def __init__(self, float_dtype=np.float32): + super().__init__() + self.float_dtype = float_dtype + self.ranges = {} + self.dtypes = {}
+ +
[docs] @annotate("reduce_dtype_size_fit", color="green", domain="nvt_python") + def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame): + return {col: (ddf[col].min(), ddf[col].max()) for col in col_selector.names}
+ +
[docs] def fit_finalize(self, dask_stats): + self.ranges = dask_stats
+ +
[docs] def clear(self): + self.dtypes = {} + self.ranges = {}
+ +
[docs] @annotate("reduce_dtype_size_transform", color="darkgreen", domain="nvt_python") + def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + for col_name, col_dtype in self.dtypes.items(): + np_dtype = col_dtype.to_numpy + df[col_name] = df[col_name].astype(np_dtype) + return df
+ +
[docs] def compute_output_schema(self, input_schema, selector, prev_output_schema=None): + if not self.ranges: + return input_schema + + output_columns = [] + for column, (min_value, max_value) in self.ranges.items(): + column = input_schema[column] + + dtype = column.dtype + if column.dtype.element_type.value == "int": + for possible_dtype in _INT_DTYPES: + dtype_range = np.iinfo(possible_dtype) + if min_value >= dtype_range.min and max_value <= dtype_range.max: + dtype = possible_dtype + break + + elif column.dtype.element_type.value == "float": + dtype = self.float_dtype + + output_columns.append(column.with_dtype(dtype)) + + self.dtypes = {column.name: column.dtype for column in output_columns} + return Schema(output_columns)
+ + transform.__doc__ = Operator.transform.__doc__ + compute_output_schema.__doc__ = Operator.compute_output_schema.__doc__ + fit.__doc__ = StatOperator.fit.__doc__ + fit_finalize.__doc__ = StatOperator.fit_finalize.__doc__ + clear.__doc__ = StatOperator.clear.__doc__
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/rename.html b/review/pr-1877/_modules/nvtabular/ops/rename.html new file mode 100644 index 00000000000..486e664a00c --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/rename.html @@ -0,0 +1,512 @@ + + + + + + + + + + + nvtabular.ops.rename — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.rename

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+from merlin.core.dispatch import DataFrameType
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class Rename(Operator): + """This operation renames columns by one of several methods: + + - using a user defined lambda function to transform column names + - appending a postfix string to every column name + - renaming a single column to a single fixed string + + Example usage:: + + # Rename columns after LogOp + cont_features = cont_names >> nvt.ops.LogOp() >> Rename(postfix='_log') + processor = nvt.Workflow(cont_features) + + Parameters + ---------- + f : callable, optional + Function that takes a column name and returns a new column name + postfix : str, optional + If set each column name in the output will have this string appended to it + name : str, optional + If set, a single input column will be renamed to this string + """ + +
[docs] def __init__(self, f=None, postfix=None, name=None): + if not f and postfix is None and name is None: + raise ValueError("must specify name, f, or postfix, for Rename op") + + self.f = f + self.postfix = postfix + self.name = name + super().__init__()
+ +
[docs] def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + df = df[col_selector.names] + df.columns = list(self.column_mapping(col_selector).keys()) + return df
+ + transform.__doc__ = Operator.transform.__doc__ + +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + for col_name in col_selector.names: + if self.f: + new_col_name = self.f(col_name) + elif self.postfix: + new_col_name = col_name + self.postfix + elif self.name: + if len(col_selector.names) == 1: + new_col_name = self.name + else: + raise RuntimeError("Single column name provided for renaming multiple columns") + else: + raise RuntimeError( + "The Rename op requires one of f, postfix, or name to be provided" + ) + + column_mapping[new_col_name] = [col_name] + + return column_mapping
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/target_encoding.html b/review/pr-1877/_modules/nvtabular/ops/target_encoding.html new file mode 100644 index 00000000000..fd498c9bb79 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/target_encoding.html @@ -0,0 +1,873 @@ + + + + + + + + + + + nvtabular.ops.target_encoding — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.target_encoding

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+import dask.dataframe as dd
+import numpy as np
+from dask.delayed import Delayed
+
+from merlin.core.dispatch import (
+    DataFrameType,
+    arange,
+    concat_columns,
+    random_state,
+    read_parquet_dispatch,
+)
+from merlin.dag import Node
+from merlin.dag.ops.stat_operator import StatOperator
+from merlin.schema import Schema, Tags
+from nvtabular.ops import categorify as nvt_cat
+from nvtabular.ops.moments import _custom_moments
+from nvtabular.ops.operator import ColumnSelector, Operator
+
+
+
[docs]class TargetEncoding(StatOperator): + """ + Target encoding is a common feature-engineering technique for + categorical columns in tabular datasets. For each categorical group, + the mean of a continuous target column is calculated, and the + group-specific mean of each row is used to create a new feature (column). + To prevent overfitting, the following additional logic is applied: + + 1. Cross Validation: To prevent overfitting in training data, + a cross-validation strategy is used - The data is split into + k random "folds", and the mean values within the i-th fold are + calculated with data from all other folds. The cross-validation + strategy is only employed when the dataset is used to update + recorded statistics. For transformation-only workflow execution, + global-mean statistics are used instead. + + 2. Smoothing: To prevent overfitting for low cardinality categories, + the means are smoothed with the overall mean of the target variable. + + Target Encoding Function:: + + TE = ((mean_cat*count_cat)+(mean_global*p_smooth)) / (count_cat+p_smooth) + + count_cat := count of the categorical value + mean_cat := mean target value of the categorical value + mean_global := mean target value of the whole dataset + p_smooth := smoothing factor + + Example usage:: + + # First, we can transform the label columns to binary targets + LABEL_COLUMNS = ['label1', 'label2'] + labels = ColumnSelector(LABEL_COLUMNS) >> (lambda col: (col>0).astype('int8')) + # We target encode cat1, cat2 and the cross columns cat1 x cat2 + target_encode = ( + ['cat1', 'cat2', ['cat2','cat3']] >> + nvt.ops.TargetEncoding( + labels, + kfold=5, + p_smooth=20, + out_dtype="float32", + ) + ) + processor = nvt.Workflow(target_encode) + + Parameters + ----------- + target : str + Continuous target column to use for the encoding of cat_groups. + The same continuous target will be used for all `cat_groups`. + target_mean : float + Global mean of the target column to use for encoding. + Supplying this value up-front will improve performance. + kfold : int, default 3 + Number of cross-validation folds to use while gathering statistics. + fold_seed : int, default 42 + Random seed to use for numpy-based fold assignment. + p_smooth : int, default 20 + Smoothing factor. + out_col : str or list of str, default is problem-specific + Name of output target-encoding column. If `cat_groups` includes + multiple elements, this should be a list of the same length (and + elements must be unique). + out_dtype : str, default is problem-specific + dtype of output target-encoding columns. + split_out : dict or int, optional + Number of files needed to store the final result of each groupby + reduction. High-cardinality groups may require a large `split_out`, + while low-cardinality columns can likely use `split_out=1` (default). + If passing a dict, each key and value should correspond to the column + name and value, respectively. The default value is 1 for all columns. + split_every : dict or int, optional + Number of adjacent partitions to aggregate in each tree-reduction + node. The default value is 8 for all columns. + cat_cache : {"device", "host", "disk"} or dict + Location to cache the list of unique categories for + each categorical column. If passing a dict, each key and value + should correspond to the column name and location, respectively. + Default is "host" for all columns. + out_path : str, optional + Root directory where category statistics will be written out in + parquet format. + on_host : bool, default True + Whether to convert cudf data to pandas between tasks in the hash-based + groupby reduction. The extra host <-> device data movement can reduce + performance. However, using `on_host=True` typically improves stability + (by avoiding device-level memory pressure). + name_sep : str, default "_" + String separator to use between concatenated column names + for multi-column groups. + drop_folds : bool, default True + Whether to drop the "__fold__" column created. This is really only useful for unittests. + """ + +
[docs] def __init__( + self, + target, + target_mean=None, + kfold=None, + fold_seed=42, + p_smooth=20, + out_col=None, + out_dtype=None, + split_out=None, + split_every=None, + cat_cache="host", + out_path=None, + on_host=True, + name_sep="_", + drop_folds=True, + tree_width=None, + ): + super().__init__() + + target = Node.construct_from(target) + self.dependency = target + self.target = target + + self.target_mean = target_mean + self.kfold = kfold or 3 + self.fold_seed = fold_seed + self.p_smooth = p_smooth + self.out_col = [out_col] if isinstance(out_col, str) else out_col + self.out_dtype = out_dtype + self.split_out = split_out + self.split_every = split_every + self.out_path = out_path or "./" + self.on_host = on_host + self.cat_cache = cat_cache + self.name_sep = name_sep + self.drop_folds = drop_folds + self.fold_name = "__fold__" + self.stats = {} + self.means = {} # TODO: just update target_mean? + nvt_cat._deprecate_tree_width(tree_width)
+ +
[docs] def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame): + moments = None + + if self.target_mean is None: + # calculate the mean if we don't have it already + moments = _custom_moments(ddf[self.target_columns]) + + col_groups = col_selector.grouped_names + + if self.kfold > 1: + # Add new fold column if necessary + if self.fold_name not in ddf.columns: + ddf[self.fold_name] = ddf.index.map_partitions( + _add_fold, + self.kfold, + self.fold_seed, + meta=_add_fold(ddf._meta.index, self.kfold, self.fold_seed), + ) + + # Add new col_groups with fold + for group in col_selector.grouped_names: + if isinstance(group, tuple): + group = list(group) + if isinstance(group, list): + col_groups.append([self.fold_name] + group) + else: + col_groups.append([self.fold_name, group]) + + dsk, key = nvt_cat._category_stats( + ddf, + nvt_cat.FitOptions( + col_groups, + self.target_columns, + ["count", "sum"], + self.out_path, + 0, + self.split_out, + self.on_host, + concat_groups=False, + name_sep=self.name_sep, + split_every=self.split_every, + ), + ) + return Delayed(key, dsk), moments
+ +
[docs] def fit_finalize(self, dask_stats): + for col, value in dask_stats[0].items(): + self.stats[col] = value + for col in dask_stats[1].index: + self.means[col] = float(dask_stats[1]["mean"].loc[col])
+ + @property + def dependencies(self): + return self.dependency + +
[docs] def compute_selector( + self, + input_schema: Schema, + selector: ColumnSelector, + parents_selector: ColumnSelector, + dependencies_selector: ColumnSelector, + ) -> ColumnSelector: + self._validate_matching_cols(input_schema, parents_selector, "computing input selector") + return parents_selector
+ +
[docs] def column_mapping(self, col_selector): + column_mapping = {} + + for group in col_selector.grouped_names: + group = ColumnSelector(group) + tag = nvt_cat._make_name(*group.names, sep=self.name_sep) + + for target_name in self.target_columns: + result_name = f"TE_{tag}_{target_name}" + column_mapping[result_name] = [target_name, *group.names] + + if self.kfold > 1 and not self.drop_folds: + column_mapping[self.fold_name] = [] + + return column_mapping
+ + def _compute_dtype(self, col_schema, input_schema): + if input_schema.column_schemas: + new_schema = super()._compute_dtype(col_schema, input_schema) + else: + # fold only, setting the dtype to int + new_schema = col_schema.with_dtype(np.uint8) + return new_schema + + def _compute_tags(self, col_schema, input_schema): + if input_schema.column_schemas: + source_col_name = input_schema.column_names[0] + return col_schema.with_tags(input_schema[source_col_name].tags + self.output_tags) + return col_schema + + @property + def output_dtype(self): + return self.out_dtype or np.float32 + + @property + def output_tags(self): + return [Tags.CONTINUOUS] + + @property + def target_columns(self): + if self.target.output_schema is not None: + return self.target.output_schema.column_names + elif self.target.selector is not None: + return self.target.selector.names + else: + return [] + + def _compute_properties(self, col_schema, input_schema): + if input_schema.column_schemas: + source_col_name = input_schema.column_names[0] + return col_schema.with_properties(input_schema[source_col_name].properties) + return col_schema + +
[docs] def set_storage_path(self, new_path, copy=False): + self.stats = nvt_cat._copy_storage(self.stats, self.out_path, new_path, copy) + self.out_path = new_path
+ +
[docs] def clear(self): + self.stats = {} + self.means = {}
+ + def _make_te_name(self, cat_group, target_columns, name_sep): + tag = nvt_cat._make_name(*cat_group, sep=name_sep) + return [f"TE_{tag}_{x}" for x in target_columns] + + def _op_group_logic(self, cat_group, df, y_mean, fit_folds, group_ind): + # Define name of new TE column + if isinstance(self.out_col, list): + if group_ind >= len(self.out_col): + raise ValueError("out_col and cat_groups are different sizes.") + out_col = self.out_col[group_ind] + out_col = [out_col] if isinstance(out_col, str) else out_col + # ToDo Test + if len(out_col) != len(self.target_columns): + raise ValueError("out_col and target are different sizes.") + else: + out_col = self._make_te_name(cat_group, self.target_columns, self.name_sep) + + # Initialize new data + _read_pq_func = read_parquet_dispatch(df) + tmp = "__tmp__" + + if fit_folds: + # Groupby Aggregation for each fold + cols = ["__fold__"] + cat_group + storage_name_folds = nvt_cat._make_name(*cols, sep=self.name_sep) + path_folds = self.stats[storage_name_folds] + agg_each_fold = nvt_cat._read_groupby_stat_df( + path_folds, storage_name_folds, self.cat_cache, _read_pq_func + ) + agg_each_fold.columns = cols + ["count_y"] + [x + "_sum_y" for x in self.target_columns] + else: + cols = cat_group + + # Groupby Aggregation for all data + storage_name_all = nvt_cat._make_name(*cat_group, sep=self.name_sep) + path_all = self.stats[storage_name_all] + agg_all = nvt_cat._read_groupby_stat_df( + path_all, storage_name_all, self.cat_cache, _read_pq_func + ) + agg_all.columns = ( + cat_group + ["count_y_all"] + [x + "_sum_y_all" for x in self.target_columns] + ) + + if fit_folds: + agg_each_fold = agg_each_fold.merge(agg_all, on=cat_group, how="left") + agg_each_fold["count_y_all"] = agg_each_fold["count_y_all"] - agg_each_fold["count_y"] + for i, x in enumerate(self.target_columns): + agg_each_fold[x + "_sum_y_all"] = ( + agg_each_fold[x + "_sum_y_all"] - agg_each_fold[x + "_sum_y"] + ) + agg_each_fold[out_col[i]] = ( + agg_each_fold[x + "_sum_y_all"] + self.p_smooth * y_mean[x] + ) / (agg_each_fold["count_y_all"] + self.p_smooth) + + agg_each_fold = agg_each_fold.drop( + ["count_y_all", "count_y"] + + [x + "_sum_y" for x in self.target_columns] + + [x + "_sum_y_all" for x in self.target_columns], + axis=1, + ) + tran_df = df[cols + [tmp]].merge(agg_each_fold, on=cols, how="left") + del agg_each_fold + else: + for i, x in enumerate(self.target_columns): + agg_all[out_col[i]] = (agg_all[x + "_sum_y_all"] + self.p_smooth * y_mean[x]) / ( + agg_all["count_y_all"] + self.p_smooth + ) + agg_all = agg_all.drop( + ["count_y_all"] + [x + "_sum_y_all" for x in self.target_columns], axis=1 + ) + tran_df = df[cols + [tmp]].merge(agg_all, on=cols, how="left") + del agg_all + + # TODO: There is no need to perform the `agg_each_fold.merge(agg_all, ...)` merge + # for every partition. We can/should cache the result for better performance. + + for i, x in enumerate(self.target_columns): + tran_df[out_col[i]] = tran_df[out_col[i]].fillna(y_mean[x]) + if self.out_dtype is not None: + tran_df[out_col] = tran_df[out_col].astype(self.out_dtype) + + tran_df = tran_df.sort_values(tmp, ignore_index=True) + tran_df.drop(columns=cols + [tmp], inplace=True) + + # Make sure we are preserving the index of df + tran_df.index = df.index + + return tran_df + +
[docs] def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + # Add temporary column for sorting + tmp = "__tmp__" + df[tmp] = arange(len(df), like_df=df, dtype="int32") + + fit_folds = self.kfold > 1 + if fit_folds: + df[self.fold_name] = _add_fold(df.index, self.kfold, self.fold_seed) + + # Need mean of contiuous target column + y_mean = self.target_mean or self.means + + # Loop over categorical-column groups and apply logic + new_df = None + for ind, cat_group in enumerate(col_selector.grouped_names): + if isinstance(cat_group, tuple): + cat_group = list(cat_group) + elif isinstance(cat_group, str): + cat_group = [cat_group] + + if new_df is None: + new_df = self._op_group_logic(cat_group, df, y_mean, fit_folds, ind).astype( + self.output_dtype + ) + else: + _df = self._op_group_logic(cat_group, df, y_mean, fit_folds, ind).astype( + self.output_dtype + ) + new_df = concat_columns([new_df, _df]) + + # Drop temporary columns + df.drop(columns=[tmp, "__fold__"] if fit_folds and self.drop_folds else [tmp], inplace=True) + if fit_folds and not self.drop_folds: + new_df[self.fold_name] = df[self.fold_name] + return new_df
+ + transform.__doc__ = Operator.transform.__doc__ + fit.__doc__ = StatOperator.fit.__doc__ + fit_finalize.__doc__ = StatOperator.fit_finalize.__doc__
+ + +def _add_fold(s, kfold, fold_seed=None): + """Deterministically computes a '__fold__' column, given an optional + random seed""" + typ = np.min_scalar_type(kfold * 2) + if fold_seed is None: + # If we don't have a specific seed, + # just use a simple modulo-based mapping + fold = arange(len(s), like_df=s, dtype=typ) + np.mod(fold, kfold, out=fold) + return fold + else: + state = random_state(fold_seed, like_df=s) + return state.choice(arange(kfold, like_df=s, dtype=typ), len(s)) +
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/ops/value_counts.html b/review/pr-1877/_modules/nvtabular/ops/value_counts.html new file mode 100644 index 00000000000..acc9015d236 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/ops/value_counts.html @@ -0,0 +1,512 @@ + + + + + + + + + + + nvtabular.ops.value_counts — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.ops.value_counts

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+
+from typing import Any
+
+import dask.dataframe as dd
+
+from merlin.core.dispatch import DataFrameType, is_list_dtype, pull_apart_list
+from merlin.dag.ops.stat_operator import StatOperator
+from nvtabular.ops.operator import ColumnSelector
+
+
+
[docs]class ValueCount(StatOperator): + """ + The operator calculates the min and max lengths of multihot columns. + """ + +
[docs] def __init__(self) -> None: + super().__init__() + self.stats = {}
+ +
[docs] def fit(self, col_selector: ColumnSelector, ddf: dd.DataFrame) -> Any: + stats = {} + for col in col_selector.names: + series = ddf[col] + if is_list_dtype(series.compute()): + stats[col] = stats[col] if col in stats else {} + stats[col]["value_count"] = ( + {} if "value_count" not in stats[col] else stats[col]["value_count"] + ) + offs = pull_apart_list(series.compute())[1] + lh, rh = offs[1:], offs[:-1] + rh = rh.reset_index(drop=True) + lh = lh.reset_index(drop=True) + deltas = lh - rh + # must be regular python class otherwise protobuf fails + stats[col]["value_count"]["min"] = int(deltas.min()) + stats[col]["value_count"]["max"] = int(deltas.max()) + return stats
+ +
[docs] def fit_finalize(self, dask_stats): + self.stats = dask_stats
+ +
[docs] def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFrameType: + return df
+ + def _compute_properties(self, col_schema, input_schema): + new_schema = super()._compute_properties(col_schema, input_schema) + stat_properties = self.stats.get(col_schema.name, {"value_count": {"min": 0, "max": None}}) + return col_schema.with_properties({**new_schema.properties, **stat_properties}) + + def _compute_shape(self, col_schema, input_schema): + new_schema = super()._compute_shape(col_schema, input_schema) + + value_counts = self.stats.get(col_schema.name, {}).get("value_count", {}) + + min_count, max_count = (0, None) + if value_counts: + min_count = value_counts.get("min", 0) + max_count = value_counts.get("max", None) + + return new_schema.with_shape((None, (min_count, max_count))) + +
[docs] def clear(self): + self.stats = {}
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_modules/nvtabular/workflow/workflow.html b/review/pr-1877/_modules/nvtabular/workflow/workflow.html new file mode 100644 index 00000000000..725bc14ec85 --- /dev/null +++ b/review/pr-1877/_modules/nvtabular/workflow/workflow.html @@ -0,0 +1,900 @@ + + + + + + + + + + + nvtabular.workflow.workflow — NVTabular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+

+ +
+
+ +
+
+
+ + + + +
+ +

Source code for nvtabular.workflow.workflow

+#
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# 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.
+#
+
+import inspect
+import json
+import logging
+import os
+import sys
+import time
+import types
+import warnings
+from functools import singledispatchmethod
+from typing import TYPE_CHECKING, Optional, Union
+
+import cloudpickle
+import fsspec
+import pandas as pd
+
+from merlin.core.compat import cudf
+from merlin.dag import Graph
+from merlin.dag.executors import DaskExecutor, LocalExecutor
+from merlin.dag.node import iter_nodes
+from merlin.dag.ops.stat_operator import StatOperator
+from merlin.io import Dataset
+from merlin.schema import Schema
+from nvtabular.ops import LambdaOp
+from nvtabular.workflow.node import WorkflowNode
+
+LOG = logging.getLogger("nvtabular")
+
+
+if TYPE_CHECKING:
+    import distributed
+
+
+
[docs]class Workflow: + """ + The Workflow class applies a graph of operations onto a dataset, letting you transform + datasets to do feature engineering and preprocessing operations. This class follows an API + similar to Transformers in sklearn: we first ``fit`` the workflow by calculating statistics + on the dataset, and then once fit we can ``transform`` datasets by applying these statistics. + + Example usage:: + + # define a graph of operations + cat_features = CAT_COLUMNS >> nvtabular.ops.Categorify() + cont_features = CONT_COLUMNS >> nvtabular.ops.FillMissing() >> nvtabular.ops.Normalize() + workflow = nvtabular.Workflow(cat_features + cont_features + "label") + + # calculate statistics on the training dataset + workflow.fit(merlin.io.Dataset(TRAIN_PATH)) + + # transform the training and validation datasets and write out as parquet + workflow.transform(merlin.io.Dataset(TRAIN_PATH)).to_parquet(output_path=TRAIN_OUT_PATH) + workflow.transform(merlin.io.Dataset(VALID_PATH)).to_parquet(output_path=VALID_OUT_PATH) + + Parameters + ---------- + output_node: WorkflowNode + The last node in the graph of operators this workflow should apply + """ + +
[docs] def __init__(self, output_node: WorkflowNode, client: Optional["distributed.Client"] = None): + self.graph = Graph(output_node) + self.executor = DaskExecutor(client)
+ +
[docs] @singledispatchmethod + def transform(self, data): + """Transforms the data by applying the graph of operators to it. + + Requires the ``fit`` method to have already been called, or + using a Workflow that has already beeen fit and re-loaded from + disk (using the ``load`` method). + + This method returns data of the same type. + + In the case of a `Dataset`. The computation is lazy. It won't + happen until the produced Dataset is consumed, or written out + to disk. e.g. with a `dataset.compute()`. + + Parameters + ----------- + data: Union[Dataset, DataFrameType] + Input Dataset or DataFrame to transform + + Returns + ------- + Dataset or DataFrame + Transformed Dataset or DataFrame with the workflow graph applied to it + + Raises + ------ + NotImplementedError + If passed an unsupoprted data type to transform. + + """ + raise NotImplementedError( + f"Workflow.transform received an unsupported type: {type(data)} " + "Supported types are a `merlin.io.Dataset` or DataFrame (pandas or cudf)" + )
+ + @transform.register + def _(self, dataset: Dataset) -> Dataset: + return self._transform_impl(dataset) + + @transform.register + def _(self, dataframe: pd.DataFrame) -> pd.DataFrame: + return self._transform_df(dataframe) + + if cudf: + + @transform.register + def _(self, dataframe: cudf.DataFrame) -> cudf.DataFrame: + return self._transform_df(dataframe) + +
[docs] def fit_schema(self, input_schema: Schema): + """Computes input and output schemas for each node in the Workflow graph + + Parameters + ---------- + input_schema : Schema + The input schema to use + + Returns + ------- + Workflow + This workflow where each node in the graph has a fitted schema + """ + self.graph.construct_schema(input_schema) + return self
+ + @property + def subworkflows(self): + return list(self.graph.subgraphs.keys()) + + @property + def input_dtypes(self): + return self.graph.input_dtypes + + @property + def input_schema(self): + return self.graph.input_schema + + @property + def output_schema(self): + return self.graph.output_schema + + @property + def output_dtypes(self): + return self.graph.output_dtypes + + @property + def output_node(self): + return self.graph.output_node + + def _input_columns(self): + return self.graph._input_columns() + +
[docs] def get_subworkflow(self, subgraph_name): + subgraph = self.graph.subgraph(subgraph_name) + return Workflow(subgraph.output_node)
+ +
[docs] def remove_inputs(self, input_cols) -> "Workflow": + """Removes input columns from the workflow. + + This is useful for the case of inference where you might need to remove label columns + from the processed set. + + Parameters + ---------- + input_cols : list of str + List of column names to + + Returns + ------- + Workflow + This workflow with the input columns removed from it + + See Also + -------- + merlin.dag.Graph.remove_inputs + """ + self.graph.remove_inputs(input_cols) + return self
+ +
[docs] def fit(self, dataset: Dataset) -> "Workflow": + """Calculates statistics for this workflow on the input dataset + + Parameters + ----------- + dataset: Dataset + The input dataset to calculate statistics for. If there is a train/test split this + data should be the training dataset only. + + Returns + ------- + Workflow + This Workflow with statistics calculated on it + """ + self.executor.fit(dataset, self.graph) + return self
+ +
[docs] def fit_transform(self, dataset: Dataset) -> Dataset: + """Convenience method to both fit the workflow and transform the dataset in a single + call. Equivalent to calling ``workflow.fit(dataset)`` followed by + ``workflow.transform(dataset)`` + + Parameters + ----------- + dataset: Dataset + Input dataset to calculate statistics on, and transform results + + Returns + ------- + Dataset + Transformed Dataset with the workflow graph applied to it + + See Also + -------- + fit + transform + """ + self.fit(dataset) + return self.transform(dataset)
+ + def _transform_impl(self, dataset: Dataset, capture_dtypes=False): + if not self.graph.output_schema: + self.graph.construct_schema(dataset.schema) + + ddf = dataset.to_ddf(columns=self._input_columns()) + + return Dataset( + self.executor.transform( + ddf, self.output_node, self.output_dtypes, capture_dtypes=capture_dtypes + ), + cpu=dataset.cpu, + base_dataset=dataset.base_dataset, + schema=self.output_schema, + ) + + def _transform_df(self, df): + if not self.graph.output_schema: + raise ValueError("no output schema") + + return LocalExecutor().transform(df, self.output_node, self.output_dtypes) + + @classmethod + def _getmodules(cls, fs): + """ + Returns an imprecise but useful approximation of the list of modules + necessary to execute a given list of functions. This approximation is + sound (all modules listed are required by the supplied functions) but not + necessarily complete (not all modules required will necessarily be returned). + + For function literals (lambda expressions), this returns + 1. the names of every module referenced in the lambda expression, e.g., + `m` for `lambda x: m.f(x)` and + 2. the names of the declaring module for every function referenced in + the lambda expression, e.g. `m` for `import m.f; lambda x: f(x)` + + For declared functions, this returns the names of their declaring modules. + + The return value will exclude all built-in modules and (on Python 3.10 or later) + all standard library modules. + """ + result = set() + + exclusions = set(sys.builtin_module_names) + if hasattr(sys, "stdlib_module_names"): + # sys.stdlib_module_names is only available in Python 3.10 and beyond + exclusions = exclusions | sys.stdlib_module_names + + for f in fs: + if f.__name__ == "<lambda>": + for closurevars in [ + inspect.getclosurevars(f).globals, + inspect.getclosurevars(f).nonlocals, + ]: + for name, val in closurevars.items(): + print(f"{name} = {val}") + if isinstance(val, types.ModuleType): + result.add(val) + elif isinstance(val, types.FunctionType): + mod = inspect.getmodule(val) + if mod is not None: + result.add(mod) + else: + mod = inspect.getmodule(f) + if mod is not None: + result.add(mod) + + return [mod for mod in result if mod.__name__ not in exclusions] + +
[docs] def save(self, path: Union[str, os.PathLike], modules_byvalue=None): + """Save this workflow to disk + + Parameters + ---------- + path: Union[str, os.PathLike] + The path to save the workflow to + modules_byvalue: + A list of modules that should be serialized by value. This + should include any modules that will not be available on + the host where this workflow is ultimately deserialized. + + In lieu of an explicit list, pass None to serialize all modules + by reference or pass "auto" to use a heuristic to infer which + modules to serialize by value. + """ + # avoid a circular import getting the version + from nvtabular import __version__ as nvt_version + + path = str(path) + + fs = fsspec.get_fs_token_paths(path)[0] + + fs.makedirs(path, exist_ok=True) + + # point all stat ops to store intermediate output (parquet etc) at the path + # this lets us easily bundle + for stat in Graph.get_nodes_by_op_type([self.output_node], StatOperator): + stat.op.set_storage_path(path, copy=True) + + # generate a file of all versions used to generate this bundle + lib = cudf if cudf else pd + with fs.open(fs.sep.join([path, "metadata.json"]), "w") as o: + json.dump( + { + "versions": { + "nvtabular": nvt_version, + lib.__name__: lib.__version__, + "python": sys.version, + }, + "generated_timestamp": int(time.time()), + }, + o, + ) + + # track existing by-value modules + preexisting_modules_byvalue = set(cloudpickle.list_registry_pickle_by_value()) + + # direct cloudpickle to serialize selected modules by value + if modules_byvalue is None: + modules_byvalue = [] + elif modules_byvalue == "auto": + l_nodes = self.graph.get_nodes_by_op_type( + list(iter_nodes([self.graph.output_node])), LambdaOp + ) + + try: + modules_byvalue = Workflow._getmodules([ln.op.f for ln in l_nodes]) + except RuntimeError as ex: + warnings.warn( + "Failed to automatically infer modules to serialize by value. " + f'Reason given was "{str(ex)}"' + ) + + try: + for m in modules_byvalue: + if isinstance(m, types.ModuleType): + cloudpickle.register_pickle_by_value(m) + elif isinstance(m, str) and m in sys.modules: + cloudpickle.register_pickle_by_value(sys.modules[m]) + except RuntimeError as ex: + warnings.warn( + f'Failed to register modules to serialize by value. Reason given was "{str(ex)}"' + ) + + try: + # dump out the full workflow (graph/stats/operators etc) using cloudpickle + with fs.open(fs.sep.join([path, "workflow.pkl"]), "wb") as o: + cloudpickle.dump(self, o) + finally: + # return all modules that we set to serialize by value to by-reference + # (i.e., retain modules that were set to serialize by value before this invocation) + + for m in modules_byvalue: + if isinstance(m, types.ModuleType): + if m.__name__ not in preexisting_modules_byvalue: + cloudpickle.unregister_pickle_by_value(m) + elif isinstance(m, str) and m in sys.modules: + if m not in preexisting_modules_byvalue: + cloudpickle.unregister_pickle_by_value(sys.modules[m])
+ +
[docs] @classmethod + def load(cls, path: Union[str, os.PathLike], client=None) -> "Workflow": + """Load up a saved workflow object from disk + + Parameters + ---------- + path: Union[str, os.PathLike] + The path to load the workflow from + client: distributed.Client, optional + The Dask distributed client to use for multi-gpu processing and multi-node processing + + Returns + ------- + Workflow + The Workflow loaded from disk + """ + # avoid a circular import getting the version + from nvtabular import __version__ as nvt_version + + path = str(path) + + fs = fsspec.get_fs_token_paths(path)[0] + + # check version information from the metadata blob, and warn if we have a mismatch + meta = json.load(fs.open(fs.sep.join([path, "metadata.json"]))) + + def parse_version(version): + return version.split(".")[:2] + + def check_version(stored, current, name): + if parse_version(stored) != parse_version(current): + warnings.warn( + f"Loading workflow generated with {name} version {stored} " + f"- but we are running {name} {current}. This might cause issues" + ) + + # make sure we don't have any major/minor version conflicts between the stored worklflow + # and the current environment + lib = cudf if cudf else pd + versions = meta["versions"] + check_version(versions["nvtabular"], nvt_version, "nvtabular") + check_version(versions["python"], sys.version, "python") + + if lib.__name__ in versions: + check_version(versions[lib.__name__], lib.__version__, lib.__name__) + else: + expected = "GPU" if "cudf" in versions else "CPU" + warnings.warn(f"Loading workflow generated on {expected}") + + # load up the workflow object di + workflow = cloudpickle.load(fs.open(fs.sep.join([path, "workflow.pkl"]), "rb")) + workflow.client = client + + # we might have been copied since saving, update all the stat ops + # with the new path to their storage locations + for stat in Graph.get_nodes_by_op_type([workflow.output_node], StatOperator): + stat.op.set_storage_path(path, copy=False) + + return workflow
+ +
[docs] def clear_stats(self): + """Removes calculated statistics from each node in the workflow graph + + See Also + -------- + nvtabular.ops.stat_operator.StatOperator.clear + """ + for stat in Graph.get_nodes_by_op_type([self.graph.output_node], StatOperator): + stat.op.clear()
+
+ +
+ + + + + + +
+ +
+
+
+ +
+ + + + +
+ + + +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/review/pr-1877/_sources/Introduction.md b/review/pr-1877/_sources/Introduction.md new file mode 100644 index 00000000000..ee66613c9fc --- /dev/null +++ b/review/pr-1877/_sources/Introduction.md @@ -0,0 +1,99 @@ +## [NVTabular](https://github.com/NVIDIA/NVTabular) + +[![PyPI](https://img.shields.io/pypi/v/NVTabular?color=orange&label=version)](https://pypi.python.org/pypi/NVTabular/) +[![LICENSE](https://img.shields.io/github/license/NVIDIA-Merlin/NVTabular)](https://github.com/NVIDIA-Merlin/NVTabular/blob/stable/LICENSE) +[![Documentation](https://img.shields.io/badge/documentation-blue.svg)](https://nvidia-merlin.github.io/NVTabular/stable/Introduction.html) + +NVTabular is a feature engineering and preprocessing library for tabular data that is designed to easily manipulate terabyte scale datasets and train deep learning (DL) based recommender systems. It provides high-level abstraction to simplify code and accelerates computation on the GPU using the [RAPIDS Dask-cuDF](https://github.com/rapidsai/cudf/tree/main/python/dask_cudf) library. + +NVTabular is a component of [NVIDIA Merlin](https://developer.nvidia.com/nvidia-merlin), an open source framework for building and deploying recommender systems and works with the other Merlin components including [Merlin Models](https://github.com/NVIDIA-Merlin/models), [HugeCTR](https://github.com/NVIDIA/HugeCTR) and [Merlin Systems](https://github.com/NVIDIA-Merlin/systems) to provide end-to-end acceleration of recommender systems on the GPU. Extending beyond model training, with NVIDIA’s [Triton Inference Server](https://github.com/NVIDIA/tensorrt-inference-server), the feature engineering and preprocessing steps performed on the data during training can be automatically applied to incoming data during inference. + + + +### Benefits + +When training DL recommender systems, data scientists and machine learning (ML) engineers have been faced with the following challenges: + +- **Huge Datasets**: Commercial recommenders are trained on huge datasets that may be several terabytes in scale. +- **Complex Data Feature Engineering and Preprocessing Pipelines**: Datasets need to be preprocessed and transformed so that they can be used with DL models and frameworks. In addition, feature engineering creates an extensive set of new features from existing ones, requiring multiple iterations to arrive at an optimal solution. +- **Input Bottleneck**: Data loading, if not well optimized, can be the slowest part of the training process, leading to under-utilization of high-throughput computing devices such as GPUs. +- **Extensive Repeated Experimentation**: The entire data engineering, training, and evaluation process can be repetitious and time consuming, requiring significant computational resources. + +NVTabular alleviates these challenges and helps data scientists and ML engineers: + +- process datasets that exceed GPU and CPU memory without having to worry about scale. +- focus on what to do with the data and not how to do it by using abstraction at the operation level. +- prepare datasets quickly and easily for experimentation so that more models can be trained. +- deploy models into production by providing faster dataset transformation + +Learn more in the NVTabular [core features documentation](https://nvidia-merlin.github.io/NVTabular/stable/core_features.html). + +### Performance + +When running NVTabular on the Criteo 1TB Click Logs Dataset using a single V100 32GB GPU, feature engineering and preprocessing was able to be completed in 13 minutes. Furthermore, when running NVTabular on a DGX-1 cluster with eight V100 GPUs, feature engineering and preprocessing was able to be completed within three minutes. Combined with [HugeCTR](http://www.github.com/NVIDIA/HugeCTR/), the dataset can be processed and a full model can be trained in only six minutes. + +The performance of the Criteo DRLM workflow also demonstrates the effectiveness of the NVTabular library. The original ETL script provided in Numpy took over five days to complete. Combined with CPU training, the total iteration time is over one week. By optimizing the ETL code in Spark and running on a DGX-1 equivalent cluster, the time to complete feature engineering and preprocessing was reduced to three hours. Meanwhile, training was completed in one hour. + +### Installation + +NVTabular requires Python version 3.7+. Additionally, GPU support requires: + +- CUDA version 11.0+ +- NVIDIA Pascal GPU or later (Compute Capability >=6.0) +- NVIDIA driver 450.80.02+ +- Linux or WSL + +#### Installing NVTabular Using Conda + +NVTabular can be installed with Anaconda from the `nvidia` channel by running the following command: + +``` +conda install -c nvidia -c rapidsai -c numba -c conda-forge nvtabular python=3.7 cudatoolkit=11.2 +``` + +#### Installing NVTabular Using Pip + +NVTabular can be installed with `pip` by running the following command: + +``` +pip install nvtabular +``` + +> Installing NVTabular with Pip causes NVTabular to run on the CPU only and might require installing additional dependencies manually. +> When you run NVTabular in one of our Docker containers, the dependencies are already installed. + +#### Installing NVTabular with Docker + +NVTabular Docker containers are available in the [NVIDIA Merlin container +repository](https://catalog.ngc.nvidia.com/?filters=&orderBy=scoreDESC&query=merlin). +The following table summarizes the key information about the containers: + +| Container Name | Container Location | Functionality | +| ----------------- | ------------------------------------------------------------------------------------ | ------------------------------------------ | +| merlin-hugectr | https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-hugectr | NVTabular, HugeCTR, and Triton Inference | +| merlin-tensorflow | https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow | NVTabular, Tensorflow and Triton Inference | +| merlin-pytorch | https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-pytorch | NVTabular, PyTorch, and Triton Inference | + +To use these Docker containers, you'll first need to install the [NVIDIA Container Toolkit](https://github.com/NVIDIA/nvidia-docker) to provide GPU support for Docker. You can use the NGC links referenced in the table above to obtain more information about how to launch and run these containers. To obtain more information about the software and model versions that NVTabular supports per container, see [Support Matrix](https://github.com/NVIDIA/NVTabular/blob/stable/docs/source/resources/support_matrix.rst). + +### Notebook Examples and Tutorials + +We provide a [collection of examples](https://github.com/NVIDIA-Merlin/NVTabular/tree/stable/examples) to demonstrate feature engineering with NVTabular as Jupyter notebooks: + +- Introduction to NVTabular's High-Level API +- Advanced workflows with NVTabular +- NVTabular on CPU +- Scaling NVTabular to multi-GPU systems + +In addition, NVTabular is used in many of our examples in other Merlin libraries: + +- [End-To-End Examples with Merlin](https://github.com/NVIDIA-Merlin/Merlin/tree/stable/examples) +- [Training Examples with Merlin Models](https://github.com/NVIDIA-Merlin/models/tree/stable/examples) +- [Training Examples with Transformer4Rec](https://github.com/NVIDIA-Merlin/Transformers4Rec/tree/stable/examples) + +### Feedback and Support + +If you'd like to contribute to the library directly, see the [Contributing.md](https://github.com/NVIDIA/NVTabular/blob/stable/CONTRIBUTING.md). We're particularly interested in contributions or feature requests for our feature engineering and preprocessing operations. To further advance our Merlin Roadmap, we encourage you to share all the details regarding your recommender system pipeline in this [survey](https://developer.nvidia.com/merlin-devzone-survey). + +If you're interested in learning more about how NVTabular works, see +[our NVTabular documentation](https://nvidia-merlin.github.io/NVTabular/stable/Introduction.html). We also have [API documentation](https://nvidia-merlin.github.io/NVTabular/stable/api/index.html) that outlines the specifics of the available calls within the library. diff --git a/review/pr-1877/_sources/api.rst b/review/pr-1877/_sources/api.rst new file mode 100644 index 00000000000..294eab67675 --- /dev/null +++ b/review/pr-1877/_sources/api.rst @@ -0,0 +1,121 @@ +***************** +API Documentation +***************** + +Workflow Constructors +--------------------- + +.. currentmodule:: nvtabular.workflow.workflow + +.. autosummary:: + :toctree: generated + + Workflow + WorkflowNode + +.. currentmodule:: nvtabular.ops + + +Categorical Operators +--------------------- + +.. autosummary:: + :toctree: generated + + Bucketize + Categorify + DropLowCardinality + HashBucket + HashedCross + TargetEncoding + + +Continuous Operators +-------------------- + +.. autosummary:: + :toctree: generated + + Clip + LogOp + Normalize + NormalizeMinMax + + +Missing Value Operators +----------------------- + +.. autosummary:: + :toctree: generated + + Dropna + FillMissing + FillMedian + + +Row Manipulation Operators +-------------------------- + +.. autosummary:: + :toctree: generated + + DifferenceLag + Filter + Groupby + JoinExternal + JoinGroupby + + +Schema Operators +---------------- + +.. autosummary:: + :toctree: generated + + AddMetadata + AddProperties + AddTags + Rename + ReduceDtypeSize + TagAsItemFeatures + TagAsItemID + TagAsUserFeatures + TagAsUserID + + +List Operators +-------------- + +.. autosummary:: + :toctree: generated + + ListSlice + ValueCount + + +Vector Operators +---------------- + +.. autosummary:: + :toctree: generated + + ColumnSimilarity + + +User-Defined Function Operators +------------------------------- + +.. autosummary:: + :toctree: generated + + LambdaOp + + +Operator Base Classes +--------------------- + +.. autosummary:: + :toctree: generated + + Operator + StatOperator \ No newline at end of file diff --git a/review/pr-1877/_sources/core_features.md b/review/pr-1877/_sources/core_features.md new file mode 100644 index 00000000000..aff10c1a803 --- /dev/null +++ b/review/pr-1877/_sources/core_features.md @@ -0,0 +1,83 @@ +# Core Features + +NVTabular supports the following core features: + +- [TensorFlow and PyTorch Interoperability](#tensorflow-and-pytorch-interoperability) +- [HugeCTR Interoperability](#hugectr-interoperability) +- [Multi-GPU Support](#multi-gpu-support) +- [Multi-Node Support](#multi-node-support) +- [Multi-Hot Encoding and Pre-Existing Embeddings](#multi-hot-encoding-and-pre-existing-embeddings) +- [Shuffling Datasets](#shuffling-datasets) +- [Cloud Integration](#cloud-integration) +- [CPU Support](#cpu-support) + +## TensorFlow and PyTorch Interoperability + +In addition to providing mechanisms for transforming the data to prepare it for deep learning models, we also have framework-specific dataloaders implemented to help optimize getting that data to the GPU. Under a traditional dataloading scheme, data is read item by item and collated into a batch. With PyTorch, multiple processes can create many batches at the same time. However, this still leads to many individual rows of tabular data being accessed independently, which impacts I/O, especially when this data is on the disk and not in the CPU memory. TensorFlow loads and shuffles TFRecords by adopting a windowed buffering scheme that loads data sequentially to a buffer, which it randomly samples batches and replenishes with the next sequential elements from the disk. Larger buffer sizes ensure more randomness, but can quickly bottleneck performance as TensorFlow tries to keep the buffer saturated. Smaller buffer sizes mean that datasets, which aren't uniformly distributed on the disk, lead to biased sampling and potentially degraded convergence. + +## HugeCTR Interoperability + +NVTabular is also capable of preprocessing datasets that can be passed to HugeCTR for training. For additional information, see the [HugeCTR Example Notebook](https://github.com/NVIDIA-Merlin/NVTabular/blob/stable/examples/scaling-criteo/03-Training-with-HugeCTR.ipynb) for details about how this works. + +## Multi-GPU Support + +NVTabular supports multi-GPU scaling with [Dask-CUDA](https://github.com/rapidsai/dask-cuda) and [dask.distributed](https://distributed.dask.org/en/latest/). To enable distributed parallelism, the NVTabular `Workflow` must be initialized with a `dask.distributed.Client` object as follows: + +```python +import nvtabular as nvt +from dask.distributed import Client + +# Deploy a new cluster +# (or specify the port of an existing scheduler) +cluster = "tcp://MachineA:8786" + +client = Client(cluster) +workflow = nvt.Workflow(..., client=client) +... +``` + +Currently, there are many ways to deploy a "cluster" for Dask. This [article](https://blog.dask.org/2020/07/23/current-state-of-distributed-dask-clusters) gives a summary of all the practical options. For a single machine with multiple GPUs, the `dask_cuda.LocalCUDACluster` API is typically the most convenient option. + +Since NVTabular already uses [Dask-CuDF](https://docs.rapids.ai/api/cudf/stable/) for internal data processing, there are no other requirements for multi-GPU scaling. With that said, the parallel performance can depend strongly on (1) the size of `Dataset` partitions, (2) the shuffling procedure used for data output, and (3) the specific arguments used for both global-statistics and transformation operations. For additional information, see [Multi-GPU](https://github.com/NVIDIA/NVTabular/blob/stable/examples/multi-gpu-toy-example/multi-gpu_dask.ipynb) for a simple step-by-step example. + +## Multi-Node Support + +NVTabular supports multi-node scaling with [Dask-CUDA](https://github.com/rapidsai/dask-cuda) and [dask.distributed](https://distributed.dask.org/en/latest/). To enable distributed parallelism, start a cluster and connect to it to run the application by doing the following: + +1. Start the scheduler `dask-scheduler`. +2. Start the workers `dask-cuda-worker schedulerIP:schedulerPort`. +3. Run the NVTabular application where the NVTabular `Workflow` has been initialized as described in the Multi-GPU Support section. + +For a detailed description of each existing method that is needed to start a cluster, please read this [article](https://blog.dask.org/2020/07/23/current-state-of-distributed-dask-clusters). + +## Multi-Hot Encoding and Pre-Existing Embeddings + +NVTabular supports the: + +- processing of datasets with multi-hot categorical columns. +- passing of continuous vector features like pre-trained embeddings, which includes basic preprocessing and feature engineering, as well as full support in the dataloaders for training models with both TensorFlow and PyTorch. + +Multi-hot lets you represent a set of categories as a single feature. For example, in a movie recommendation system, each movie might have a list of genres associated with it like comedy, drama, horror, or science fiction. Since movies can belong to more than one genre, we can't use single-hot encoding like we are doing for scalar +columns. Instead we train models with multi-hot embeddings for these features by having the deep learning model look up an embedding for each category in the list and then average all the embeddings for each row. Both multi-hot categoricals and vector continuous features are represented using list columns in our datasets. cuDF has recently added support for list columns, and we're leveraging that support in NVTabular to power this feature. + +Our Categorify and HashBucket operators can map list columns down to small contiguous integers, which are suitable for use in an embedding lookup table. This is only possible if the dataset contains two rows like `[['comedy', 'horror'], ['comedy', 'sciencefiction']]` so that NVTabular can transform the strings for each row into categorical IDs like `[[0, 1], [0, 2]]` to be used in our embedding layers. + +Our PyTorch and TensorFlow dataloaders have been extended to handle both categorical and continuous list columns. In TensorFlow, the KerasSequenceLoader class will transform each list column into two tensors representing the values and offsets into those values for each batch. These tensors can be converted into RaggedTensors for multi-hot columns, and for vector continuous columns where the offsets tensor can be safely ignored. We've provided a `nvtabular.framework_utils.tensorflow.layers.DenseFeatures` Keras layer that will automatically handle these conversions for both continuous and categorical columns. For PyTorch, there's support for multi-hot columns to our `nvtabular.framework_utils.torch.models.Model` class, which internally is using the PyTorch [EmbeddingBag](https://pytorch.org/docs/stable/generated/torch.nn.EmbeddingBag.html) layer to handle the multi-hot columns. + +## Shuffling Datasets + +NVTabular makes it possible to shuffle during dataset creation. This creates a uniformly shuffled dataset that allows the dataloader to load large contiguous chunks of data, which are already randomized across the entire dataset. NVTabular also makes it possible to control the number of chunks that are combined into a batch, providing flexibility when trading off between performance and true randomization. This mechanism is critical when dealing with datasets that exceed CPU memory and individual epoch shuffling is desired during training. Full shuffle of such a dataset can exceed training time for the epoch by several orders of magnitude. + +## Cloud Integration + +NVTabular offers cloud integration with Amazon Web Services (AWS) and Google Cloud Platform (GCP), giving you the ability to build, train, and deploy models on the cloud using datasets. For additional information, see [Amazon Web Services](./resources/cloud_integration.md#amazon-web-services) and [Google Cloud Platform](./resources/cloud_integration.md#google-cloud-platform). + +## CPU Support + +NVTabular supports CPU using [pandas](https://pandas.pydata.org/), [pyarrow](https://arrow.apache.org/docs/python/), and [dask dataframe](https://examples.dask.org/dataframe.html). To enable CPU, the Dataset class must be initialized with the `cpu` parameter as follows: + +``` +dataset = Dataset(path, cpu=True) +``` + +Processing will now take place on the CPU for that particular dataset, including feature engineering and preprocessing as well as TensorFlow and PyTorch training using NVTabular's dataloaders. diff --git a/review/pr-1877/_sources/examples/01-Getting-started.ipynb b/review/pr-1877/_sources/examples/01-Getting-started.ipynb new file mode 100644 index 00000000000..29e8de747c4 --- /dev/null +++ b/review/pr-1877/_sources/examples/01-Getting-started.ipynb @@ -0,0 +1,725 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "bb28e271", + "metadata": {}, + "outputs": [], + "source": [ + "# Copyright 2022 NVIDIA Corporation. All Rights Reserved.\n", + "#\n", + "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", + "# you may not use this file except in compliance with the License.\n", + "# You may obtain a copy of the License at\n", + "#\n", + "# http://www.apache.org/licenses/LICENSE-2.0\n", + "#\n", + "# Unless required by applicable law or agreed to in writing, software\n", + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", + "# See the License for the specific language governing permissions and\n", + "# limitations under the License.\n", + "# ==============================================================================\n", + "\n", + "# Each user is responsible for checking the content of datasets and the\n", + "# applicable licenses and determining if suitable for the intended use." + ] + }, + { + "cell_type": "markdown", + "id": "77464844", + "metadata": {}, + "source": [ + "\n", + "\n", + "# Getting Started with NVTabular: Process Tabular Data On GPU\n", + "\n", + "This notebook is created using the latest stable [merlin-tensorflow](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow/tags) container. \n", + "\n", + "## Overview\n", + "\n", + "[Merlin NVTabular](https://github.com/NVIDIA-Merlin/NVTabular) is a library for processing tabular data. It lets Data Scientists and ML Engineers easily process data leveraging custom operators specifically designed for machine learning workflows. The processing is carried out on the GPU with best practices baked into the library. Running on the GPU translates to faster iteration cycles and, thanks to leveraging `dask`, enables working on arbitrarily large datasets. NVTabular is a part of the [Merlin open source framework](https://developer.nvidia.com/nvidia-merlin) which allows for seamless transitioning to working with your preprocessed data using the numerous other libraries, including ones for model construction and serving.\n", + "\n", + "Training a machine learning model ofen requires preprocessing data and engineering features. In this example, we want to train a neural network with embedding layers based on two categorical features: `userId` and `movieId`. Embedding layers require that the categorical features are continuous integers. In this example, we will show how to use the `Categorify` operator to transform the categorical features for training a model\n", + "\n", + "Core features of Merlin NVTabular:\n", + "- Many different operators (`Categorify`, `FillMissing`, `TargetEncoding`, `Groupby`, etc) tailored for processing tabular data at scale\n", + "- Flexible APIs targeted to both production and research\n", + "- Deep integration with NVIDIA Merlin platform, including Merlin Models for constructing and training Deep Learning models and Merlin Systems for model serving\n", + "\n", + "\n", + "### Learning objectives\n", + "\n", + "- Processing the Movielens dataset.\n", + "- Understanding Merlin NVTabular high-level concepts (Dataset, Workflow)\n", + "- A first look at operators and defining the preprocessing workflow" + ] + }, + { + "cell_type": "markdown", + "id": "1c5598ae", + "metadata": {}, + "source": [ + "## Downloading the dataset\n", + "\n", + "### MovieLens25M\n", + "\n", + "The [MovieLens25M](https://grouplens.org/datasets/movielens/25m/) is a popular dataset for recommender systems and is widely used in academic publications. The dataset contains 25M movie ratings for 62,000 movies given by 162,000 users. Many projects use only the user/item/rating information of MovieLens, but the original dataset provides metadata for the movies, as well. For example, which genres a movie has.\n", + "\n", + "To streamline obtaining data, we will use a function from Merlin Models." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "60653f70", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-08-31 04:04:15.362393: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:15.362838: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:15.362976: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "/usr/local/lib/python3.8/dist-packages/cudf/core/frame.py:384: UserWarning: The deep parameter is ignored and is only included for pandas compatibility.\n", + " warnings.warn(\n" + ] + } + ], + "source": [ + "import os\n", + "from merlin.datasets.entertainment import get_movielens\n", + "\n", + "input_path = os.environ.get(\"INPUT_DATA_DIR\", os.path.expanduser(\"~/merlin-framework/movielens/\"))\n", + "get_movielens(variant=\"ml-1m\", path=input_path);" + ] + }, + { + "cell_type": "markdown", + "id": "ab95b716", + "metadata": {}, + "source": [ + "The original dataset has been preprocessed to make it easier to work with. Instead of having to deal with `dat` files, we can read files directly into a `DataFrame` using the parquet format.\n", + "\n", + "The data has already been split for us into train and validation sets." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "f7293205", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "README ratings.dat users.dat\r\n", + "movies.dat train.parquet users_converted.parquet\r\n", + "movies_converted.parquet \u001b[0m\u001b[01;34mtransformed\u001b[0m/ valid.parquet\r\n" + ] + } + ], + "source": [ + "ls {input_path}/ml-1m #noqa" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "c0c3cae3", + "metadata": {}, + "outputs": [], + "source": [ + "from merlin.core.dispatch import get_lib\n", + "\n", + "train = get_lib().read_parquet(f'{input_path}ml-1m/train.parquet')\n", + "valid = get_lib().read_parquet(f'{input_path}ml-1m/valid.parquet')" + ] + }, + { + "cell_type": "markdown", + "id": "1b83f0f2", + "metadata": {}, + "source": [ + "From the provided `train` and `validation` sets we will extract `userId`, `movieId` and `rating`." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "bdf108aa", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
userIdmovieIdratingtimestamp
25965815873563974740825
834974501812994962583606
15380298817214976397962
36380221191514974997851
834543501513934962594210
\n", + "
" + ], + "text/plain": [ + " userId movieId rating timestamp\n", + "259658 1587 356 3 974740825\n", + "834974 5018 1299 4 962583606\n", + "153802 988 1721 4 976397962\n", + "363802 2119 151 4 974997851\n", + "834543 5015 1393 4 962594210" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "train.head()" + ] + }, + { + "cell_type": "markdown", + "id": "03b3152e", + "metadata": {}, + "source": [ + "## Processing the dataset with NVTabular" + ] + }, + { + "cell_type": "markdown", + "id": "2ee5c7c2", + "metadata": {}, + "source": [ + "### Defining the workflow" + ] + }, + { + "cell_type": "markdown", + "id": "6d75cb24", + "metadata": {}, + "source": [ + "Before we can leverage `NVTabular`, we need to convert our data to a `Merlin Dataset`.\n", + "\n", + "We achieve this by passing the `DataFrame` to the `Dataset` constructor." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "d0f72d61", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(,\n", + " )" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import nvtabular as nvt\n", + "from merlin.schema.tags import Tags\n", + "\n", + "train_ds = nvt.Dataset(train)\n", + "valid_ds = nvt.Dataset(valid)\n", + "\n", + "train_ds, valid_ds" + ] + }, + { + "cell_type": "markdown", + "id": "5c3ec1a1", + "metadata": {}, + "source": [ + "Now that we have read in our data, let's define a workflow.\n", + "\n", + "A workflow consists of one or more preprocessing steps that will be applied to our data.\n", + "\n", + "We begin by converting `userId` and `movieId` columns to categories. In our dataset, they are already represented as integers, but many models require them to be continuous integers, which is not something we can guarantee about our input data if we don't preprocess it. Further to that, in order to train models on our data, we need to ensure we handle categories not seen in the train dataset.\n", + "\n", + "We accomplish both of these with the `Categorify` operator." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "ce735546", + "metadata": {}, + "outputs": [], + "source": [ + "output = ['userId', 'movieId'] >> nvt.ops.Categorify()" + ] + }, + { + "cell_type": "markdown", + "id": "35c1126d", + "metadata": {}, + "source": [ + "Above, we are instructing `NVTabular` to select the `userId` and `movieId` columns and to apply the `Categorify` operator to them. We store the results as `output`.\n", + "\n", + "When we run the cell, the actual operation is not performed. Only a graph representation of the operation is created." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "fa9c3a00", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": "\n\n\n\n\n\n%3\n\n\n\n0\n\nCategorify\n\n\n\n2\n\noutput cols\n\n\n\n0->2\n\n\n\n\n\n1\n\nSelectionOp\n\n\n\n1->0\n\n\n\n\n\n1_selector\n\n['userId', 'movieId']\n\n\n\n1_selector->1\n\n\n\n\n\n", + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "output.graph" + ] + }, + { + "cell_type": "markdown", + "id": "d556ac20", + "metadata": {}, + "source": [ + "Let us also add our target to the set of returned columns.\n", + "\n", + "Additionally, we tag the `rating` column with appropriate tags. This will allow other components of the Merlin Framework to use this information and minimize the code we will have to write to perform complex operations such as training or serving a Deep Learning model.\n", + "\n", + "If you would like to learn more about using `Tags`, take a look at the [NVTabular and Merlin Models integrated example](https://nvidia-merlin.github.io/models/stable/examples/02-Merlin-Models-and-NVTabular-integration.html) notebook in the Merlin Models [repository](https://github.com/NVIDIA-Merlin/models)." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "83c0f78a", + "metadata": {}, + "outputs": [], + "source": [ + "output += ['rating'] >> nvt.ops.AddMetadata(tags=[Tags.REGRESSION, Tags.TARGET])" + ] + }, + { + "cell_type": "markdown", + "id": "7fc778ca", + "metadata": {}, + "source": [ + "We are now ready to construct a `Workflow` that will run the operations we defined above." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "6b7226fc", + "metadata": {}, + "outputs": [], + "source": [ + "workflow = nvt.Workflow(output)" + ] + }, + { + "cell_type": "markdown", + "id": "f3ce8958", + "metadata": {}, + "source": [ + "### Applying the workflow to the train and validation sets" + ] + }, + { + "cell_type": "markdown", + "id": "3f342e03", + "metadata": {}, + "source": [ + "`NVTabular` follows the familiar `sklearn` API. We can fit the workflow to our train set and subsequently use it to transform our validation dataset." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "03391bb8", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.8/dist-packages/cudf/core/frame.py:384: UserWarning: The deep parameter is ignored and is only included for pandas compatibility.\n", + " warnings.warn(\n" + ] + } + ], + "source": [ + "workflow.fit_transform(train_ds).to_parquet('train')\n", + "workflow.transform(valid_ds).to_parquet('valid')" + ] + }, + { + "cell_type": "markdown", + "id": "65053a94", + "metadata": {}, + "source": [ + "We have `fit` our workflow to the train set. During this operation, the workflow computed and stored a mapping from `userId` and `movieId` values in the dataset to their encoded representation as continuous integers.\n", + "\n", + "Subsequently, we have transformed the train set and encoded the `userId` and `movieId` columns (both operations were performed when we called `fit_transform`).\n", + "\n", + "Last but not list, we transform our validation dataset using values computed on the train set.\n", + "\n", + "We output both datasets to disk." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "60c23ef1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "_file_list.txt _metadata _metadata.json part_0.parquet schema.pbtxt\r\n" + ] + } + ], + "source": [ + "ls train" + ] + }, + { + "cell_type": "markdown", + "id": "568a22eb", + "metadata": {}, + "source": [ + "Let us now load our transformed data and see whether everything looks as expected." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "d95c8237", + "metadata": {}, + "outputs": [], + "source": [ + "train_transformed = nvt.Dataset('train', engine='parquet')\n", + "valid_transformed = nvt.Dataset('valid', engine='parquet')" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "187dbb9e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
userIdmovieIdrating
0320283
112783544
23408634
317475694
4204994
\n", + "
" + ], + "text/plain": [ + " userId movieId rating\n", + "0 320 28 3\n", + "1 1278 354 4\n", + "2 3408 63 4\n", + "3 1747 569 4\n", + "4 204 99 4" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "train_transformed.head()" + ] + }, + { + "cell_type": "markdown", + "id": "d83847fe", + "metadata": {}, + "source": [ + "Let's finish off this notebook with training a DLRM (a Deep Learning Recommendation Model introduced in [Deep Learning Recommendation Model for Personalization and Recommendation Systems](https://arxiv.org/abs/1906.00091)) on our preprocessed data.\n", + "\n", + "To learn more about the integration between NVTabular and Merlin Models, please see the [NVTabular and Merlin Models integrated example](https://nvidia-merlin.github.io/models/stable/examples/02-Merlin-Models-and-NVTabular-integration.html) in the Merlin Models [repository](https://github.com/NVIDIA-Merlin/models)." + ] + }, + { + "cell_type": "markdown", + "id": "a6ff4c40", + "metadata": {}, + "source": [ + "## Training a DLRM model" + ] + }, + { + "cell_type": "markdown", + "id": "688b89c7", + "metadata": {}, + "source": [ + "We define the DLRM model, whose prediction task is a binary classification. From the `schema`, the categorical features are identified (and embedded) and the target column is also automatically inferred, because of the schema tags. We talk more about the schema in the next example notebook, [Advanced NVTabular Workflow](02-Advanced-NVTabular-workflow.ipynb)." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "7be72270", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-08-31 04:04:17.240242: I tensorflow/core/platform/cpu_feature_guard.cc:194] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE3 SSE4.1 SSE4.2 AVX\n", + "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", + "2022-08-31 04:04:17.241058: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:17.241240: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:17.241375: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:17.241645: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:17.241789: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:17.241929: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-31 04:04:17.242051: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 24576 MB memory: -> device: 0, name: Quadro RTX 8000, pci bus id: 0000:08:00.0, compute capability: 7.5\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/5\n", + "782/782 [==============================] - 6s 5ms/step - loss: 1.2843 - root_mean_squared_error: 1.1333 - regularization_loss: 0.0000e+00 - val_loss: 0.8349 - val_root_mean_squared_error: 0.9137 - val_regularization_loss: 0.0000e+00\n", + "Epoch 2/5\n", + "782/782 [==============================] - 4s 5ms/step - loss: 0.8268 - root_mean_squared_error: 0.9093 - regularization_loss: 0.0000e+00 - val_loss: 0.8105 - val_root_mean_squared_error: 0.9003 - val_regularization_loss: 0.0000e+00\n", + "Epoch 3/5\n", + "782/782 [==============================] - 3s 4ms/step - loss: 0.8017 - root_mean_squared_error: 0.8954 - regularization_loss: 0.0000e+00 - val_loss: 0.7988 - val_root_mean_squared_error: 0.8938 - val_regularization_loss: 0.0000e+00\n", + "Epoch 4/5\n", + "782/782 [==============================] - 3s 4ms/step - loss: 0.7863 - root_mean_squared_error: 0.8868 - regularization_loss: 0.0000e+00 - val_loss: 0.7915 - val_root_mean_squared_error: 0.8897 - val_regularization_loss: 0.0000e+00\n", + "Epoch 5/5\n", + "782/782 [==============================] - 3s 4ms/step - loss: 0.7734 - root_mean_squared_error: 0.8794 - regularization_loss: 0.0000e+00 - val_loss: 0.7855 - val_root_mean_squared_error: 0.8863 - val_regularization_loss: 0.0000e+00\n", + "Epoch 1/3\n", + "782/782 [==============================] - 4s 4ms/step - loss: 0.7360 - root_mean_squared_error: 0.8579 - regularization_loss: 0.0000e+00 - val_loss: 0.7744 - val_root_mean_squared_error: 0.8800 - val_regularization_loss: 0.0000e+00\n", + "Epoch 2/3\n", + "782/782 [==============================] - 4s 5ms/step - loss: 0.7267 - root_mean_squared_error: 0.8525 - regularization_loss: 0.0000e+00 - val_loss: 0.7722 - val_root_mean_squared_error: 0.8788 - val_regularization_loss: 0.0000e+00\n", + "Epoch 3/3\n", + "782/782 [==============================] - 3s 4ms/step - loss: 0.7221 - root_mean_squared_error: 0.8497 - regularization_loss: 0.0000e+00 - val_loss: 0.7727 - val_root_mean_squared_error: 0.8791 - val_regularization_loss: 0.0000e+00\n" + ] + } + ], + "source": [ + "import tensorflow\n", + "import merlin.models.tf as mm\n", + "\n", + "model = mm.DLRMModel(\n", + " train_transformed.schema,\n", + " embedding_dim=64,\n", + " bottom_block=mm.MLPBlock([128, 64]),\n", + " top_block=mm.MLPBlock([128, 64, 32]),\n", + " prediction_tasks=mm.RegressionTask('rating')\n", + ")\n", + "\n", + "opt = tensorflow.optimizers.Adam(learning_rate=1e-3)\n", + "model.compile(optimizer=opt)\n", + "model.fit(train_transformed, validation_data=valid_transformed, batch_size=1024, epochs=5)\n", + "\n", + "model.optimizer.learning_rate = 1e-4\n", + "metrics = model.fit(train_transformed, validation_data=valid_transformed, batch_size=1024, epochs=3)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4c8353a0", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "2a6ad327", + "metadata": {}, + "source": [ + "## Conclusion" + ] + }, + { + "cell_type": "markdown", + "id": "eeba861b", + "metadata": {}, + "source": [ + "NVTabular exposes operators tailored for processing tabular data at scale with machine learning best practices baked into the library. It tightly integrates with the rest of the Merlin Framework to streamline model construction, training and serving." + ] + }, + { + "cell_type": "markdown", + "id": "c9180e84", + "metadata": {}, + "source": [ + "## Next steps" + ] + }, + { + "cell_type": "markdown", + "id": "b9ba3102", + "metadata": {}, + "source": [ + "In subsequent notebooks, we will define more advanaced workflows and custom operators. We will also take a closer look at exporting NVTabular datasets and workflows at running in different environments (CPU, GPU and multi-GPU)." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3.8.13 64-bit ('3.8.13')", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + }, + "merlin": { + "containers": [ + "nvcr.io/nvidia/merlin/merlin-tensorflow:latest" + ] + }, + "vscode": { + "interpreter": { + "hash": "5278529888a7d71bb985f02ff9083b63772563f3bf182683e4d2f66c9c40ed1c" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/review/pr-1877/_sources/examples/02-Advanced-NVTabular-workflow.ipynb b/review/pr-1877/_sources/examples/02-Advanced-NVTabular-workflow.ipynb new file mode 100644 index 00000000000..bb97df931f6 --- /dev/null +++ b/review/pr-1877/_sources/examples/02-Advanced-NVTabular-workflow.ipynb @@ -0,0 +1,1100 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "bb28e271", + "metadata": {}, + "outputs": [], + "source": [ + "# Copyright 2022 NVIDIA Corporation. All Rights Reserved.\n", + "#\n", + "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", + "# you may not use this file except in compliance with the License.\n", + "# You may obtain a copy of the License at\n", + "#\n", + "# http://www.apache.org/licenses/LICENSE-2.0\n", + "#\n", + "# Unless required by applicable law or agreed to in writing, software\n", + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", + "# See the License for the specific language governing permissions and\n", + "# limitations under the License.\n", + "# ==============================================================================\n", + "\n", + "# Each user is responsible for checking the content of datasets and the\n", + "# applicable licenses and determining if suitable for the intended use." + ] + }, + { + "cell_type": "markdown", + "id": "77464844", + "metadata": {}, + "source": [ + "\n", + "\n", + "# Advanced NVTabular Workflow\n", + "\n", + "This notebook is created using the latest stable [merlin-tensorflow](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow/tags) container. \n", + "\n", + "## Overview\n", + "\n", + "This notebook builds on what is covered in [01-Getting-started NB](01-Getting-started.ipynb). In this notebook we will take a closer look at running more complex `Operators`.\n", + "\n", + "We will also examine the functionality of the `Schema` -- this can be very useful for learning more about our data and instructing which columns we would like to use and how.\n", + "\n", + "\n", + "### Learning objectives\n", + "\n", + "- Leveraging more complex Merlin NVTabular Operators\n", + "- Splitting our data in chunks to limit memory footprint\n", + "- Understanding the role of the schema and modifying it" + ] + }, + { + "cell_type": "markdown", + "id": "1c5598ae", + "metadata": {}, + "source": [ + "## Downloading the dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "60653f70", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-09-13 07:41:27.850043: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-09-13 07:41:27.850489: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-09-13 07:41:27.850632: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "/usr/local/lib/python3.8/dist-packages/cudf/core/frame.py:384: UserWarning: The deep parameter is ignored and is only included for pandas compatibility.\n", + " warnings.warn(\n" + ] + } + ], + "source": [ + "import os\n", + "from merlin.datasets.entertainment import get_movielens\n", + "\n", + "input_path = os.environ.get(\"INPUT_DATA_DIR\", os.path.expanduser(\"~/merlin-framework/movielens/\"))\n", + "get_movielens(variant=\"ml-1m\", path=input_path); #noqa" + ] + }, + { + "cell_type": "markdown", + "id": "412d4c12", + "metadata": {}, + "source": [ + "## Reading in the data" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "f775d893", + "metadata": {}, + "outputs": [], + "source": [ + "from merlin.core.dispatch import get_lib\n", + "\n", + "data = get_lib().read_parquet(f'{input_path}ml-1m/train.parquet').sample(frac=1)\n", + "\n", + "train = data.iloc[:600_000]\n", + "valid = data.iloc[600_000:]\n", + "\n", + "movies = get_lib().read_parquet(f'{input_path}ml-1m/movies_converted.parquet')" + ] + }, + { + "cell_type": "markdown", + "id": "1b83f0f2", + "metadata": {}, + "source": [ + "From the provided `train` and `validation` sets we extract `userId`, `movieId` and `rating`." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "bdf108aa", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
userIdmovieIdratingtimestamp
315038188016743975379394
835377502134684962583655
10578769922052986531971
15001296616531975115827
13719288339114975260600
\n", + "
" + ], + "text/plain": [ + " userId movieId rating timestamp\n", + "315038 1880 1674 3 975379394\n", + "835377 5021 3468 4 962583655\n", + "105787 699 2205 2 986531971\n", + "150012 966 1653 1 975115827\n", + "137192 883 3911 4 975260600" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "train.head()" + ] + }, + { + "cell_type": "markdown", + "id": "42ffafa0", + "metadata": {}, + "source": [ + "We will also use the metadata contained in `movies`." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "86a8d694", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
movieIdtitlegenres
01Toy Story (1995)[Animation, Children's, Comedy]
12Jumanji (1995)[Adventure, Children's, Fantasy]
23Grumpier Old Men (1995)[Comedy, Romance]
34Waiting to Exhale (1995)[Comedy, Drama]
45Father of the Bride Part II (1995)[Comedy]
\n", + "
" + ], + "text/plain": [ + " movieId title \\\n", + "0 1 Toy Story (1995) \n", + "1 2 Jumanji (1995) \n", + "2 3 Grumpier Old Men (1995) \n", + "3 4 Waiting to Exhale (1995) \n", + "4 5 Father of the Bride Part II (1995) \n", + "\n", + " genres \n", + "0 [Animation, Children's, Comedy] \n", + "1 [Adventure, Children's, Fantasy] \n", + "2 [Comedy, Romance] \n", + "3 [Comedy, Drama] \n", + "4 [Comedy] " + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "movies.head()" + ] + }, + { + "cell_type": "markdown", + "id": "6d75cb24", + "metadata": {}, + "source": [ + "Let's create `Merlin Dataset`s that we will be able to run through our workflow (a workflow defines the operations we would like performed on our data)." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "d0f72d61", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(,\n", + " )" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import nvtabular as nvt\n", + "from merlin.schema.tags import Tags\n", + "\n", + "train_ds = nvt.Dataset(train, npartitions=2)\n", + "valid_ds = nvt.Dataset(valid)\n", + "\n", + "train_ds, valid_ds" + ] + }, + { + "cell_type": "markdown", + "id": "ecf6eda0", + "metadata": {}, + "source": [ + "The constructor `nvt.Dataset(...)` accepts an important parameter: `npartitions`. We can leverage it to specify into how many chunks we would like our data to be split. Our workflow will process data in chunks and by increasing the number of partitions we can limit the memory footprint.\n", + "\n", + "We have to remember though to shuffle the data so that all relevant records reside in a single partition. Otherwise, depending on the operations we chose to perform, the results of our workflow might be incorrect." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "b09971ea", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "train_ds.shuffle_by_keys('userId')\n", + "valid_ds.shuffle_by_keys('userId')" + ] + }, + { + "cell_type": "markdown", + "id": "298ee6fb", + "metadata": {}, + "source": [ + "We have now shuffled the records so that all examples for the same `userId` reside in the same partition.\n", + "\n", + "The number of partitions hasn't changed." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "86d80fb7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "train_ds.npartitions" + ] + }, + { + "cell_type": "markdown", + "id": "2ee5c7c2", + "metadata": {}, + "source": [ + "## Defining the workflow" + ] + }, + { + "cell_type": "markdown", + "id": "ad73fc70", + "metadata": {}, + "source": [ + "### Joining an external dataset" + ] + }, + { + "cell_type": "markdown", + "id": "7f849efd", + "metadata": {}, + "source": [ + "We want to make use of information contained in the `movies` DataFrame.\n", + "\n", + "Let us join it onto our data, making sure we only select the `genres` column." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "4f5ad3a2", + "metadata": {}, + "outputs": [], + "source": [ + "genres = ['movieId'] >> nvt.ops.JoinExternal(movies, on='movieId', columns_ext=['movieId', 'genres'])" + ] + }, + { + "cell_type": "markdown", + "id": "0956648e", + "metadata": {}, + "source": [ + "The `genres` information is represented as a list of strings. In order for us to be able to use it for training an ML model we need to encode the strings as categories." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "174360dc", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0 [Animation, Children's, Comedy]\n", + "1 [Adventure, Children's, Fantasy]\n", + "2 [Comedy, Romance]\n", + "3 [Comedy, Drama]\n", + "4 [Comedy]\n", + "Name: genres, dtype: list" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "movies['genres'].head()" + ] + }, + { + "cell_type": "markdown", + "id": "0242c3a0", + "metadata": {}, + "source": [ + "### Encoding a list of strings as categories" + ] + }, + { + "cell_type": "markdown", + "id": "70ab23a9", + "metadata": {}, + "source": [ + "We leverage the `Categorify` operator to encode our lists of strings.\n", + "\n", + "Additionally, let's treat the categories that appear infrequently as unknowns." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "45562fe9", + "metadata": {}, + "outputs": [], + "source": [ + "genres = genres >> nvt.ops.Categorify(freq_threshold=10)" + ] + }, + { + "cell_type": "markdown", + "id": "cc1004cf", + "metadata": {}, + "source": [ + "### Running a custom preprocessing step" + ] + }, + { + "cell_type": "markdown", + "id": "fdf87e58", + "metadata": {}, + "source": [ + "Let's look at an example of how we can run a custom preprocessing step on our data.\n", + "\n", + "Here we will define our own function that will transform the `rating` column to `binary_rating`. We will output a value of False for any `rating` below 4 and a value of True for any rating of `4` or `5`." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "20fd4f8a", + "metadata": {}, + "outputs": [], + "source": [ + "def rating_to_binary(col):\n", + " return col > 3" + ] + }, + { + "cell_type": "markdown", + "id": "7bf46a55", + "metadata": {}, + "source": [ + "The `LambdaOp` is an operator that takes in a function and performs a rowwise transformation.\n", + "\n", + "Here, `LambdaOp` takes in the `rating_to_binary` function and will apply it to the values in the `rating` column." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "96b2806d", + "metadata": {}, + "outputs": [], + "source": [ + "binary_rating = ['rating'] >> nvt.ops.LambdaOp(rating_to_binary) >> nvt.ops.Rename(name='binary_rating')" + ] + }, + { + "cell_type": "markdown", + "id": "666439ad", + "metadata": {}, + "source": [ + "### Tagging columns" + ] + }, + { + "cell_type": "markdown", + "id": "357ca53e", + "metadata": {}, + "source": [ + "Let us also tag our columns. This will help streamline model training and serving down the road, should we opt to do so using other components of the Merlin Framework.\n", + "\n", + "Running NVTabular operators on our data automatically tags the output columns. For instance, the `Categorify` operator we used above will tag the output columns as `Tags.CATEGORICAL`. Still, some information that can be useful down the road needs to be added by hand. This is true for instance for target information. Let's add this information below." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "0748ac37", + "metadata": {}, + "outputs": [], + "source": [ + "userId = ['userId'] >> nvt.ops.Categorify() >> nvt.ops.AddTags(tags=[Tags.USER_ID, Tags.CATEGORICAL, Tags.USER])\n", + "movieId = ['movieId'] >> nvt.ops.Categorify() >> nvt.ops.AddTags(tags=[Tags.ITEM_ID, Tags.CATEGORICAL, Tags.ITEM])\n", + "binary_rating = binary_rating >> nvt.ops.AddTags(tags=[Tags.TARGET, Tags.BINARY_CLASSIFICATION])" + ] + }, + { + "cell_type": "markdown", + "id": "f3ce8958", + "metadata": {}, + "source": [ + "## Applying the workflow to the train and validation sets" + ] + }, + { + "cell_type": "markdown", + "id": "0790675d", + "metadata": {}, + "source": [ + "We are now ready to create our workflow." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "6b7226fc", + "metadata": {}, + "outputs": [], + "source": [ + "workflow = nvt.Workflow(userId + movieId + genres + binary_rating)" + ] + }, + { + "cell_type": "markdown", + "id": "754ac346", + "metadata": {}, + "source": [ + "Let us now fit the `workflow` to our train set and transform the train and validation sets." + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "4aef5e8a", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.8/dist-packages/cudf/core/frame.py:384: UserWarning: The deep parameter is ignored and is only included for pandas compatibility.\n", + " warnings.warn(\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
userIdmovieIdgenresbinary_rating
01121326[1]True
12511508[1]True
2147254[7, 1]True
32555238[1]True
45661000[3, 8, 4]False
\n", + "
" + ], + "text/plain": [ + " userId movieId genres binary_rating\n", + "0 112 1326 [1] True\n", + "1 251 1508 [1] True\n", + "2 147 254 [7, 1] True\n", + "3 2555 238 [1] True\n", + "4 566 1000 [3, 8, 4] False" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "train_transformed = workflow.fit_transform(train_ds)\n", + "valid_transformed = workflow.transform(valid_ds)\n", + "valid_transformed.compute().head()" + ] + }, + { + "cell_type": "markdown", + "id": "0bd00418", + "metadata": {}, + "source": [ + "Our data was processed as we expected.\n", + "\n", + "Let us look at the schema." + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "778956ee", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
nametagsdtypeis_listis_raggedproperties.num_bucketsproperties.freq_thresholdproperties.max_sizeproperties.start_indexproperties.cat_pathproperties.domain.minproperties.domain.maxproperties.domain.nameproperties.embedding_sizes.cardinalityproperties.embedding_sizes.dimension
0userId(Tags.USER, Tags.CATEGORICAL, Tags.USER_ID)int64FalseFalseNaN0.00.00.0.//categories/unique.userId.parquet0.06041.0userId6041.0210.0
1movieId(Tags.ITEM_ID, Tags.ITEM, Tags.CATEGORICAL)int64FalseFalseNaN0.00.00.0.//categories/unique.movieId.parquet0.01852.0movieId1852.0108.0
2genres(Tags.CATEGORICAL)int64TrueTrueNaN100.00.00.0.//categories/unique.genres.parquet0.019.0genres19.016.0
3binary_rating(Tags.BINARY_CLASSIFICATION, Tags.TARGET)boolFalseFalseNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", + "
" + ], + "text/plain": [ + "[{'name': 'userId', 'tags': {, , }, 'properties': {'num_buckets': None, 'freq_threshold': 0, 'max_size': 0, 'start_index': 0, 'cat_path': './/categories/unique.userId.parquet', 'domain': {'min': 0, 'max': 6041, 'name': 'userId'}, 'embedding_sizes': {'cardinality': 6041, 'dimension': 210}}, 'dtype': dtype('int64'), 'is_list': False, 'is_ragged': False}, {'name': 'movieId', 'tags': {, , }, 'properties': {'num_buckets': None, 'freq_threshold': 0, 'max_size': 0, 'start_index': 0, 'cat_path': './/categories/unique.movieId.parquet', 'domain': {'min': 0, 'max': 1852, 'name': 'movieId'}, 'embedding_sizes': {'cardinality': 1852, 'dimension': 108}}, 'dtype': dtype('int64'), 'is_list': False, 'is_ragged': False}, {'name': 'genres', 'tags': {}, 'properties': {'num_buckets': None, 'freq_threshold': 100, 'max_size': 0, 'start_index': 0, 'cat_path': './/categories/unique.genres.parquet', 'domain': {'min': 0, 'max': 19, 'name': 'genres'}, 'embedding_sizes': {'cardinality': 19, 'dimension': 16}}, 'dtype': dtype('int64'), 'is_list': True, 'is_ragged': True}, {'name': 'binary_rating', 'tags': {, }, 'properties': {}, 'dtype': dtype('bool'), 'is_list': False, 'is_ragged': False}]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "train_transformed.schema" + ] + }, + { + "cell_type": "markdown", + "id": "48029e4b", + "metadata": {}, + "source": [ + "The schema contains a lot of useful information, such as the frequency threshold that was used to process a column or its cardinality.\n", + "\n", + "Beyond providing us with useful information, schema can be used to inform other components of the Merlin Framework on what information from our datasets we would like it to act on and in what way.\n", + "\n", + "This is what the `Tags.TARGET`, `Tags.ITEM_ID`, and `Tags.USER_ID` achieve. When we train our Deep Leranin, the model will be able to infer which columns it should use as a source of what type of information.\n", + "\n", + "We can also use the schema to remove information that we wouldn't want our model to use in training.\n", + "\n", + "Let us look at an example of that below." + ] + }, + { + "cell_type": "markdown", + "id": "18f16be0", + "metadata": {}, + "source": [ + "## Training a DLRM Model" + ] + }, + { + "cell_type": "markdown", + "id": "2f84cec3", + "metadata": {}, + "source": [ + "Let us train a DLRM Model.\n", + "\n", + "It is usually advantageous to train on the entiriety of the available data. Let us do so below -- we will utilize all the columns included in our schema file.\n", + "\n", + "We tell the model about the structure of our data by passing in the `Schema` (`train_transformed.schema` in the example below)." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "6fafc27b", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-08-24 23:45:16.972498: I tensorflow/core/platform/cpu_feature_guard.cc:194] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE3 SSE4.1 SSE4.2 AVX\n", + "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", + "2022-08-24 23:45:16.973379: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-24 23:45:16.973563: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-24 23:45:16.973699: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-24 23:45:16.973972: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-24 23:45:16.974118: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-24 23:45:16.974257: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-08-24 23:45:16.974377: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 24576 MB memory: -> device: 0, name: Quadro RTX 8000, pci bus id: 0000:08:00.0, compute capability: 7.5\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/5\n", + "782/782 [==============================] - 14s 13ms/step - loss: 0.5644 - precision: 0.7184 - recall: 0.8133 - binary_accuracy: 0.7092 - auc: 0.7688 - regularization_loss: 0.0000e+00 - val_loss: 0.5397 - val_precision: 0.7416 - val_recall: 0.8116 - val_binary_accuracy: 0.7290 - val_auc: 0.7955 - val_regularization_loss: 0.0000e+00\n", + "Epoch 2/5\n", + "782/782 [==============================] - 9s 11ms/step - loss: 0.5418 - precision: 0.7363 - recall: 0.8131 - binary_accuracy: 0.7250 - auc: 0.7907 - regularization_loss: 0.0000e+00 - val_loss: 0.5288 - val_precision: 0.7366 - val_recall: 0.8376 - val_binary_accuracy: 0.7343 - val_auc: 0.8043 - val_regularization_loss: 0.0000e+00\n", + "Epoch 3/5\n", + "782/782 [==============================] - 10s 12ms/step - loss: 0.5331 - precision: 0.7403 - recall: 0.8172 - binary_accuracy: 0.7299 - auc: 0.7984 - regularization_loss: 0.0000e+00 - val_loss: 0.5184 - val_precision: 0.7562 - val_recall: 0.8081 - val_binary_accuracy: 0.7398 - val_auc: 0.8119 - val_regularization_loss: 0.0000e+00\n", + "Epoch 4/5\n", + "782/782 [==============================] - 9s 12ms/step - loss: 0.5248 - precision: 0.7453 - recall: 0.8207 - binary_accuracy: 0.7355 - auc: 0.8058 - regularization_loss: 0.0000e+00 - val_loss: 0.5080 - val_precision: 0.7599 - val_recall: 0.8182 - val_binary_accuracy: 0.7468 - val_auc: 0.8203 - val_regularization_loss: 0.0000e+00\n", + "Epoch 5/5\n", + "782/782 [==============================] - 9s 12ms/step - loss: 0.5162 - precision: 0.7519 - recall: 0.8204 - binary_accuracy: 0.7410 - auc: 0.8133 - regularization_loss: 0.0000e+00 - val_loss: 0.4997 - val_precision: 0.7601 - val_recall: 0.8349 - val_binary_accuracy: 0.7534 - val_auc: 0.8287 - val_regularization_loss: 0.0000e+00\n", + "Epoch 1/3\n", + "782/782 [==============================] - 10s 12ms/step - loss: 0.4921 - precision: 0.7671 - recall: 0.8265 - binary_accuracy: 0.7558 - auc: 0.8325 - regularization_loss: 0.0000e+00 - val_loss: 0.4798 - val_precision: 0.7747 - val_recall: 0.8338 - val_binary_accuracy: 0.7649 - val_auc: 0.8422 - val_regularization_loss: 0.0000e+00\n", + "Epoch 2/3\n", + "782/782 [==============================] - 10s 12ms/step - loss: 0.4815 - precision: 0.7739 - recall: 0.8304 - binary_accuracy: 0.7628 - auc: 0.8406 - regularization_loss: 0.0000e+00 - val_loss: 0.4685 - val_precision: 0.7804 - val_recall: 0.8411 - val_binary_accuracy: 0.7725 - val_auc: 0.8505 - val_regularization_loss: 0.0000e+00\n", + "Epoch 3/3\n", + "782/782 [==============================] - 10s 12ms/step - loss: 0.4717 - precision: 0.7797 - recall: 0.8349 - binary_accuracy: 0.7694 - auc: 0.8478 - regularization_loss: 0.0000e+00 - val_loss: 0.4578 - val_precision: 0.7901 - val_recall: 0.8385 - val_binary_accuracy: 0.7790 - val_auc: 0.8580 - val_regularization_loss: 0.0000e+00\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import tensorflow\n", + "import merlin.models.tf as mm\n", + "\n", + "model = mm.DLRMModel(\n", + " train_transformed.schema,\n", + " embedding_dim=64,\n", + " bottom_block=mm.MLPBlock([128, 64]),\n", + " top_block=mm.MLPBlock([128, 64, 32]),\n", + " prediction_tasks=mm.BinaryClassificationTask('rating_binary')\n", + ")\n", + "\n", + "opt = tensorflow.optimizers.Adam(learning_rate=5e-3)\n", + "model.compile(optimizer=opt)\n", + "model.fit(train_transformed, validation_data=valid_transformed, batch_size=1024, epochs=5)\n", + "\n", + "model.optimizer.learning_rate = 1e-3\n", + "model.fit(train_transformed, validation_data=valid_transformed, batch_size=1024, epochs=3)" + ] + }, + { + "cell_type": "markdown", + "id": "1af903a8", + "metadata": {}, + "source": [ + "Let us now retry the training without the `genres` information. Maybe we have reason to suspect this data has some issues and we would like to verify how the model performs without this information being passed in.\n", + "\n", + "We can achieve all this by modifying the passed in schema using the `without` method." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "3e8132d1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/5\n", + "782/782 [==============================] - 10s 11ms/step - loss: 0.5666 - precision_1: 0.7193 - recall_1: 0.8067 - binary_accuracy: 0.7078 - auc_1: 0.7668 - regularization_loss: 0.0000e+00 - val_loss: 0.5415 - val_precision_1: 0.7386 - val_recall_1: 0.8128 - val_binary_accuracy: 0.7268 - val_auc_1: 0.7936 - val_regularization_loss: 0.0000e+00\n", + "Epoch 2/5\n", + "782/782 [==============================] - 8s 10ms/step - loss: 0.5451 - precision_1: 0.7343 - recall_1: 0.8115 - binary_accuracy: 0.7227 - auc_1: 0.7880 - regularization_loss: 0.0000e+00 - val_loss: 0.5314 - val_precision_1: 0.7508 - val_recall_1: 0.7996 - val_binary_accuracy: 0.7320 - val_auc_1: 0.8009 - val_regularization_loss: 0.0000e+00\n", + "Epoch 3/5\n", + "782/782 [==============================] - 8s 10ms/step - loss: 0.5374 - precision_1: 0.7398 - recall_1: 0.8116 - binary_accuracy: 0.7274 - auc_1: 0.7949 - regularization_loss: 0.0000e+00 - val_loss: 0.5239 - val_precision_1: 0.7529 - val_recall_1: 0.8055 - val_binary_accuracy: 0.7361 - val_auc_1: 0.8070 - val_regularization_loss: 0.0000e+00\n", + "Epoch 4/5\n", + "782/782 [==============================] - 8s 9ms/step - loss: 0.5307 - precision_1: 0.7423 - recall_1: 0.8171 - binary_accuracy: 0.7316 - auc_1: 0.8007 - regularization_loss: 0.0000e+00 - val_loss: 0.5171 - val_precision_1: 0.7567 - val_recall_1: 0.8113 - val_binary_accuracy: 0.7415 - val_auc_1: 0.8134 - val_regularization_loss: 0.0000e+00\n", + "Epoch 5/5\n", + "782/782 [==============================] - 8s 10ms/step - loss: 0.5233 - precision_1: 0.7476 - recall_1: 0.8185 - binary_accuracy: 0.7366 - auc_1: 0.8073 - regularization_loss: 0.0000e+00 - val_loss: 0.5092 - val_precision_1: 0.7577 - val_recall_1: 0.8232 - val_binary_accuracy: 0.7468 - val_auc_1: 0.8196 - val_regularization_loss: 0.0000e+00\n", + "Epoch 1/3\n", + "782/782 [==============================] - 8s 10ms/step - loss: 0.5038 - precision_1: 0.7594 - recall_1: 0.8249 - binary_accuracy: 0.7489 - auc_1: 0.8235 - regularization_loss: 0.0000e+00 - val_loss: 0.4938 - val_precision_1: 0.7656 - val_recall_1: 0.8327 - val_binary_accuracy: 0.7571 - val_auc_1: 0.8316 - val_regularization_loss: 0.0000e+00\n", + "Epoch 2/3\n", + "782/782 [==============================] - 8s 10ms/step - loss: 0.4953 - precision_1: 0.7637 - recall_1: 0.8316 - binary_accuracy: 0.7551 - auc_1: 0.8303 - regularization_loss: 0.0000e+00 - val_loss: 0.4856 - val_precision_1: 0.7670 - val_recall_1: 0.8440 - val_binary_accuracy: 0.7628 - val_auc_1: 0.8381 - val_regularization_loss: 0.0000e+00\n", + "Epoch 3/3\n", + "782/782 [==============================] - 8s 10ms/step - loss: 0.4881 - precision_1: 0.7674 - recall_1: 0.8360 - binary_accuracy: 0.7599 - auc_1: 0.8360 - regularization_loss: 0.0000e+00 - val_loss: 0.4781 - val_precision_1: 0.7727 - val_recall_1: 0.8451 - val_binary_accuracy: 0.7679 - val_auc_1: 0.8437 - val_regularization_loss: 0.0000e+00\n" + ] + } + ], + "source": [ + "import tensorflow\n", + "import merlin.models.tf as mm\n", + "\n", + "model = mm.DLRMModel(\n", + " train_transformed.schema.without('genres'), # <--- this is where we make the change\n", + " embedding_dim=64,\n", + " bottom_block=mm.MLPBlock([128, 64]),\n", + " top_block=mm.MLPBlock([128, 64, 32]),\n", + " prediction_tasks=mm.BinaryClassificationTask('rating_binary')\n", + ")\n", + "\n", + "opt = tensorflow.optimizers.Adam(learning_rate=5e-3)\n", + "model.compile(optimizer=opt)\n", + "model.fit(train_transformed, validation_data=valid_transformed, batch_size=1024, epochs=5)\n", + "\n", + "model.optimizer.learning_rate = 1e-3\n", + "metrics = model.fit(train_transformed, validation_data=valid_transformed, batch_size=1024, epochs=3)" + ] + }, + { + "cell_type": "markdown", + "id": "05c9f35b", + "metadata": {}, + "source": [ + "As it turns out, `genres` contained signal that was genuinely useful to the model as without it the performance on the validation set decreased!\n", + "\n", + "Using the `Schema` (combined with the ability of the Merlin Framework to infer the appropriate shape of the model based on our data) we can streamline the training and experimentation phase to a significant extent." + ] + }, + { + "cell_type": "markdown", + "id": "3a999265", + "metadata": {}, + "source": [ + "## Next steps" + ] + }, + { + "cell_type": "markdown", + "id": "c89f0cca", + "metadata": {}, + "source": [ + "We are using NVTabular in our Merlin repositories to preprocess and engineer features before training. We can recommend multiple examples, which show complex pipelines with NVTabular:\n", + "\n", + "* [This notebook](https://github.com/NVIDIA-Merlin/models/blob/stable/examples/usecases/ecommerce-session-based-next-item-prediction-for-fashion.ipynb) demonstrates how to aggregate data -- we are going from multiple rows of session information to a single row describing a session.\n", + "\n", + "* The [following notebook](https://github.com/NVIDIA-Merlin/Transformers4Rec/blob/stable/examples/end-to-end-session-based/01-ETL-with-NVTabular.ipynb) demonstrates how to derive features from timestamps and how to define a custom operator (`ItemRecency`).\n", + "\n", + "- In [this notebook](https://github.com/NVIDIA-Merlin/publications/blob/main/tutorials/RecSys22tutorial/02-Implementing-RecSys-architectures.ipynb), among other functionality, you can familiarize yourself with using `TargetEncoding`, filling missing values, `Normalization` as well as adding various `MetaData`. Do note, this notebook is not maintained and thus there might be discrepancies between it and the most up to date version of NVTabular." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3.8.13 64-bit ('3.8.13')", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + }, + "merlin": { + "containers": [ + "nvcr.io/nvidia/merlin/merlin-tensorflow:latest" + ] + }, + "vscode": { + "interpreter": { + "hash": "5278529888a7d71bb985f02ff9083b63772563f3bf182683e4d2f66c9c40ed1c" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/review/pr-1877/_sources/examples/03-Running-on-multiple-GPUs-or-on-CPU.ipynb b/review/pr-1877/_sources/examples/03-Running-on-multiple-GPUs-or-on-CPU.ipynb new file mode 100644 index 00000000000..3c90574ff5f --- /dev/null +++ b/review/pr-1877/_sources/examples/03-Running-on-multiple-GPUs-or-on-CPU.ipynb @@ -0,0 +1,826 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "bb28e271", + "metadata": {}, + "outputs": [], + "source": [ + "# Copyright 2022 NVIDIA Corporation. All Rights Reserved.\n", + "#\n", + "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", + "# you may not use this file except in compliance with the License.\n", + "# You may obtain a copy of the License at\n", + "#\n", + "# http://www.apache.org/licenses/LICENSE-2.0\n", + "#\n", + "# Unless required by applicable law or agreed to in writing, software\n", + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", + "# See the License for the specific language governing permissions and\n", + "# limitations under the License.\n", + "# ==============================================================================\n", + "\n", + "# Each user is responsible for checking the content of datasets and the\n", + "# applicable licenses and determining if suitable for the intended use." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "77464844", + "metadata": {}, + "source": [ + "\n", + "\n", + "# Running on multiple GPUs or on CPU\n", + "\n", + "This notebook is created using the latest stable [merlin-tensorflow](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/merlin/containers/merlin-tensorflow/tags) container. \n", + "\n", + "## Overview\n", + "\n", + "In this notebook we will look at running NVTabular operations on multiple GPUs or just on the CPU.\n", + "\n", + "NVTabular supports switching easily between multi-GPU, single GPU and CPU with only changing a parameter or two. A common use-case is to develop locally on the CPU and then deploy the NVTabular workflow in the cloud on a multi-GPU cluster.\n", + "\n", + "The default behavior is to use a single GPU if available, otherwise to run on the CPU. However, moving to multiple GPUs can offer speedups by 100-1000x vs CPU only workflows (you can read more about this in our [blog post](https://developer.nvidia.com/blog/announcing-the-nvtabular-open-beta-with-multi-gpu-support-and-new-data-loaders/)). Still the key word here is having options -- there will be some workloads you might want to run on multiple GPUs, a single GPU, or maybe even on your laptop with only a couple of CPU cores. NVTabular facilitates all these scenarios.\n", + "\n", + "\n", + "### Learning objectives\n", + "\n", + "- Setting up a dask cluster and executing transformations on multiple GPUs\n", + "- Running CPU only workflows" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "1c5598ae", + "metadata": {}, + "source": [ + "## Downloading the dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "60653f70", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-09-13 07:22:51.069388: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-09-13 07:22:51.069848: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "2022-09-13 07:22:51.069987: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:991] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n", + "downloading ml-1m.zip: 5.93MB [00:02, 1.98MB/s] \n", + "unzipping files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 58.48files/s]\n", + "/usr/local/lib/python3.8/dist-packages/pandas/util/_decorators.py:311: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.\n", + " return func(*args, **kwargs)\n", + "INFO:merlin.datasets.entertainment.movielens.dataset:starting ETL..\n", + "/usr/local/lib/python3.8/dist-packages/cudf/core/frame.py:384: UserWarning: The deep parameter is ignored and is only included for pandas compatibility.\n", + " warnings.warn(\n" + ] + } + ], + "source": [ + "import os\n", + "from merlin.datasets.entertainment import get_movielens\n", + "\n", + "input_path = os.environ.get(\"INPUT_DATA_DIR\", os.path.expanduser(\"~/merlin-framework/movielens/\"))\n", + "train, valid = get_movielens(variant=\"ml-1m\", path=input_path); #noqa" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "63ac0cf2", + "metadata": {}, + "source": [ + "## Running on multiple-GPUs" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "4def0005", + "metadata": {}, + "source": [ + "### Multi-GPU and multi-node scaling\n", + "\n", + "NVTabular is built on top off [RAPIDS.AI cuDF](https://github.com/rapidsai/cudf/), [dask_cudf](https://docs.rapids.ai/api/cudf/stable/) and [dask](https://dask.org/).

\n", + "**Dask** is a task-based library for parallel scheduling and execution. Although it is certainly possible to use the task-scheduling machinery directly to implement customized parallel workflows (we do it in NVTabular), most users only interact with Dask through a Dask Collection API. The most popular \"collection\" API's include:\n", + "\n", + "* Dask DataFrame: Dask-based version of the Pandas DataFrame/Series API. Note that dask_cudf is just a wrapper around this collection module (dask.dataframe).\n", + "* Dask Array: Dask-based version of the NumPy array API\n", + "* Dask Bag: Similar to a Dask-based version of PyToolz or a Pythonic version of PySpark RDD\n", + "\n", + "For example, Dask DataFrame provides a convenient API for decomposing large Pandas (or cuDF) DataFrame/Series objects into a collection of DataFrame partitions.\n", + "\n", + "\n", + "\n", + "We use **dask_cudf** to process large datasets as a collection of cuDF dataframes instead of Pandas. CuDF is a GPU DataFrame library for loading, joining, aggregating, filtering, and otherwise manipulating data.\n", + "

\n", + "**Dask enables easily to schedule tasks for multiple workers: multi-GPU or multi-node. We just need to initialize a Dask cluster (`LocalCUDACluster`) and NVTabular will use the cluster to execute the workflow.**" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d7c3f9ea", + "metadata": {}, + "source": [ + "## Starting a dask cluster" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "8e3a7479", + "metadata": {}, + "outputs": [], + "source": [ + "import numba\n", + "import warnings\n", + "from dask_cuda import LocalCUDACluster\n", + "from dask.distributed import Client\n", + "import nvtabular as nvt\n", + "from merlin.core.compat import pynvml_mem_size, device_mem_size\n", + "\n", + "dask_workdir = \"test_dask/workdir\"" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "728c3009", + "metadata": {}, + "source": [ + "The following code will automatically generate the parameters for the local CUDA cluster. It will infer the number of GPUs, calculate memory limits that work across a vast array of scenarios, and so on." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "a906e3fd", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_11/2427665162.py:26: UserWarning: BEWARE - 1.25140992 GB is already occupied on device 0!\n", + " warnings.warn(f\"BEWARE - {used} GB is already occupied on device {int(dev)}!\")\n" + ] + } + ], + "source": [ + "# Dask dashboard\n", + "dashboard_port = \"8787\"\n", + "\n", + "# Deploy a Single-Machine Multi-GPU Cluster\n", + "protocol = \"tcp\" # \"tcp\" or \"ucx\"\n", + "\n", + "if numba.cuda.is_available():\n", + " NUM_GPUS = list(range(len(numba.cuda.gpus)))\n", + "else:\n", + " NUM_GPUS = []\n", + "try:\n", + " visible_devices = os.environ[\"CUDA_VISIBLE_DEVICES\"]\n", + "except KeyError:\n", + " visible_devices = \",\".join([str(n) for n in NUM_GPUS]) # Delect devices to place workers\n", + "device_limit_frac = 0.7 # Spill GPU-Worker memory to host at this limit.\n", + "device_pool_frac = 0.8\n", + "part_mem_frac = 0.15\n", + "\n", + "# Use total device size to calculate args.device_limit_frac\n", + "device_size = device_mem_size(kind=\"total\")\n", + "device_limit = int(device_limit_frac * device_size)\n", + "device_pool_size = int(device_pool_frac * device_size)\n", + "part_size = int(part_mem_frac * device_size)\n", + "\n", + "# Check if any device memory is already occupied\n", + "if NUM_GPUS:\n", + " devices = visible_devices.split(\",\")\n", + "else:\n", + " devices = []\n", + "for dev in devices:\n", + " fmem = pynvml_mem_size(kind=\"free\", index=int(dev))\n", + " used = (device_size - fmem) / 1e9\n", + " if used > 1.0:\n", + " warnings.warn(f\"BEWARE - {used} GB is already occupied on device {int(dev)}!\")\n", + "\n", + "cluster = None # (Optional) Specify existing scheduler port" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d14dc098", + "metadata": {}, + "source": [ + "We can now initialize the CUDA cluster." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "e02409ee", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-09-13 07:23:07,266 - distributed.diskutils - INFO - Found stale lock file and directory '/workspace/examples/test_dask/workdir/dask-worker-space/worker-kymfv__r', purging\n", + "2022-09-13 07:23:07,266 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize\n" + ] + } + ], + "source": [ + "if cluster is None and NUM_GPUS:\n", + " cluster = LocalCUDACluster(\n", + " protocol=protocol,\n", + " n_workers=len(visible_devices.split(\",\")),\n", + " CUDA_VISIBLE_DEVICES=visible_devices,\n", + " device_memory_limit=device_limit,\n", + " local_directory=dask_workdir,\n", + " dashboard_address=\":\" + dashboard_port,\n", + " rmm_pool_size=(device_pool_size // 256) * 256\n", + " )" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "0576affe", + "metadata": {}, + "source": [ + "We can now start the local cluster.\n", + "\n", + "Before we do so, please take a look at the options available to us in the `Client(...)` constructor. Instead of initializing a cluster locally, another option available to us is connecting to a remote CUDA cluster. Such cluster might not only include multiple GPUs, but can also span multiple nodes. This enables scaling to running on arbitrarily large data." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "ed563c92", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2022-08-26 01:26:46,865 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize\n", + "2022-08-26 01:26:46,950 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize\n", + "2022-08-26 01:26:47,005 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize\n", + "2022-08-26 01:26:47,055 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "
\n", + "
\n", + "
\n", + "

LocalCUDACluster

\n", + "

2e6080b9

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + "\n", + " \n", + "
\n", + " Dashboard: http://127.0.0.1:8787/status\n", + " \n", + " Workers: 4\n", + "
\n", + " Total threads: 4\n", + " \n", + " Total memory: 200.00 GiB\n", + "
Status: runningUsing processes: True
\n", + "\n", + "
\n", + " \n", + "

Scheduler Info

\n", + "
\n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Scheduler

\n", + "

Scheduler-7a8e2cfa-1686-4776-9bcf-c86e5c18a5e5

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " Comm: tcp://127.0.0.1:41433\n", + " \n", + " Workers: 4\n", + "
\n", + " Dashboard: http://127.0.0.1:8787/status\n", + " \n", + " Total threads: 4\n", + "
\n", + " Started: Just now\n", + " \n", + " Total memory: 200.00 GiB\n", + "
\n", + "
\n", + "
\n", + "\n", + "
\n", + " \n", + "

Workers

\n", + "
\n", + "\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 0

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:40153\n", + " \n", + " Total threads: 1\n", + "
\n", + " Dashboard: http://127.0.0.1:43187/status\n", + " \n", + " Memory: 50.00 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:46225\n", + "
\n", + " Local directory: /workspace/evalRS-solution/notebooks/merlin_tutorial/NVTabular/examples/test_dask/workdir/dask-worker-space/worker-3riao_o_\n", + "
\n", + " GPU: Tesla V100-SXM2-16GB-N\n", + " \n", + " GPU memory: 15.78 GiB\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 1

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:43431\n", + " \n", + " Total threads: 1\n", + "
\n", + " Dashboard: http://127.0.0.1:39807/status\n", + " \n", + " Memory: 50.00 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:42207\n", + "
\n", + " Local directory: /workspace/evalRS-solution/notebooks/merlin_tutorial/NVTabular/examples/test_dask/workdir/dask-worker-space/worker-9k_oqu4c\n", + "
\n", + " GPU: Tesla V100-SXM2-16GB-N\n", + " \n", + " GPU memory: 15.78 GiB\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 2

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:33193\n", + " \n", + " Total threads: 1\n", + "
\n", + " Dashboard: http://127.0.0.1:41143/status\n", + " \n", + " Memory: 50.00 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:38113\n", + "
\n", + " Local directory: /workspace/evalRS-solution/notebooks/merlin_tutorial/NVTabular/examples/test_dask/workdir/dask-worker-space/worker-m7zmswkr\n", + "
\n", + " GPU: Tesla V100-SXM2-16GB-N\n", + " \n", + " GPU memory: 15.78 GiB\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Worker: 3

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "\n", + "
\n", + " Comm: tcp://127.0.0.1:39303\n", + " \n", + " Total threads: 1\n", + "
\n", + " Dashboard: http://127.0.0.1:35327/status\n", + " \n", + " Memory: 50.00 GiB\n", + "
\n", + " Nanny: tcp://127.0.0.1:43879\n", + "
\n", + " Local directory: /workspace/evalRS-solution/notebooks/merlin_tutorial/NVTabular/examples/test_dask/workdir/dask-worker-space/worker-g6sunve5\n", + "
\n", + " GPU: Tesla V100-SXM2-16GB-N\n", + " \n", + " GPU memory: 15.78 GiB\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "\n", + "
\n", + "
\n", + "\n", + "
\n", + "
\n", + "
" + ], + "text/plain": [ + "LocalCUDACluster(2e6080b9, 'tcp://127.0.0.1:41433', workers=4, threads=4, memory=200.00 GiB)" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "if cluster:\n", + " client = Client(cluster)\n", + "else:\n", + " client = Client(processes=False)\n", + "client.cluster" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "94ef0024", + "metadata": {}, + "source": [ + "And that's it! All we have to do is define the cluster, and NVTabular will automatically run the workload on available hardware!\n", + "\n", + "Let's put this to a test." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "768fc24e", + "metadata": {}, + "source": [ + "## Defining and running a Workflow on multiple GPUs" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "8d204def", + "metadata": {}, + "outputs": [], + "source": [ + "categories = ['userId', 'movieId', 'zipcode'] >> nvt.ops.Categorify(freq_threshold=10)\n", + "age = ['age'] >> nvt.ops.Bucketize([0, 10, 21, 45])\n", + "\n", + "example_workflow = nvt.Workflow(categories + age)\n", + "example_workflow.fit_transform(train).to_parquet('train')\n", + "example_workflow.transform(valid).to_parquet('valid')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "61785127", + "metadata": {}, + "source": [ + "We can see below that data has been loaded onto all our GPUs. All of them have been utilized in running the calculations." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "f04f42d3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Fri Aug 26 01:26:54 2022 \n", + "+-----------------------------------------------------------------------------+\n", + "| NVIDIA-SMI 470.82.01 Driver Version: 470.82.01 CUDA Version: 11.7 |\n", + "|-------------------------------+----------------------+----------------------+\n", + "| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n", + "| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n", + "| | | MIG M. |\n", + "|===============================+======================+======================|\n", + "| 0 Tesla V100-SXM2... On | 00000000:06:00.0 Off | 0 |\n", + "| N/A 35C P0 71W / 160W | 14349MiB / 16160MiB | 0% Default |\n", + "| | | N/A |\n", + "+-------------------------------+----------------------+----------------------+\n", + "| 1 Tesla V100-SXM2... On | 00000000:07:00.0 Off | 0 |\n", + "| N/A 33C P0 49W / 160W | 13568MiB / 16160MiB | 0% Default |\n", + "| | | N/A |\n", + "+-------------------------------+----------------------+----------------------+\n", + "| 2 Tesla V100-SXM2... On | 00000000:0A:00.0 Off | 0 |\n", + "| N/A 33C P0 48W / 160W | 13568MiB / 16160MiB | 0% Default |\n", + "| | | N/A |\n", + "+-------------------------------+----------------------+----------------------+\n", + "| 3 Tesla V100-SXM2... On | 00000000:0B:00.0 Off | 0 |\n", + "| N/A 34C P0 49W / 160W | 13568MiB / 16160MiB | 0% Default |\n", + "| | | N/A |\n", + "+-------------------------------+----------------------+----------------------+\n", + " \n", + "+-----------------------------------------------------------------------------+\n", + "| Processes: |\n", + "| GPU GI CI PID Type Process name GPU Memory |\n", + "| ID ID Usage |\n", + "|=============================================================================|\n", + "+-----------------------------------------------------------------------------+\n" + ] + } + ], + "source": [ + "!nvidia-smi" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "01ea40bb", + "metadata": {}, + "source": [ + "## Running on CPU" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "987f3274", + "metadata": {}, + "source": [ + "How do we run the workflow only on the CPU? To do so, we create our Datasets and specify that they should be backed by the CPU. Neither GPU memory, nor GPU processing, will be utilized." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "3def6df6", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/usr/local/lib/python3.8/dist-packages/merlin/io/dataset.py:251: UserWarning: Initializing an NVTabular Dataset in CPU mode.This is an experimental feature with extremely limited support!\n", + " warnings.warn(\n" + ] + } + ], + "source": [ + "train = nvt.Dataset('train', engine='parquet', cpu=True)\n", + "valid = nvt.Dataset('valid', engine='parquet', cpu=True)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "b06c962e", + "metadata": {}, + "source": [ + "We can now execute the workflow on the CPU." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "0d64b3f3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "example_workflow = nvt.Workflow(categories + age)\n", + "example_workflow.fit_transform(train)\n", + "example_workflow.transform(valid)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d28ae761", + "metadata": {}, + "source": [ + "In summary, if you would like to create a Dataset directly on the CPU, you can do so via passing `True` as the `cpu` parameter into the constructor as follows.\n", + "\n", + "`nvt.Dataset(..., cpu=True)`" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "4e07864d", + "metadata": {}, + "source": [ + "## Summary" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "8f971a22", + "metadata": {}, + "source": [ + "NVTabular works seamlessly across a variety of settings. NVTabular operators can be run on the CPU and scale to accommodate multi-GPU or multi-node clusters with minimum amount of configuration required." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.16" + }, + "merlin": { + "containers": [ + "nvcr.io/nvidia/merlin/merlin-tensorflow:latest" + ] + }, + "vscode": { + "interpreter": { + "hash": "5278529888a7d71bb985f02ff9083b63772563f3bf182683e4d2f66c9c40ed1c" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/review/pr-1877/_sources/examples/index.md b/review/pr-1877/_sources/examples/index.md new file mode 100644 index 00000000000..497046d8989 --- /dev/null +++ b/review/pr-1877/_sources/examples/index.md @@ -0,0 +1,68 @@ +# NVTabular Example Notebooks + +In this library, we provide a collection of Jupyter notebooks, which demonstrates the functionality of NVTabular. + +## Inventory + +- [Getting Started with NVTabular](01-Getting-started.ipynb): Get started with NVTabular by processing data on the GPU. + +- [Advanced NVTabular workflow](02-Advanced-NVTabular-workflow.ipynb): Understand NVTabular in more detail by defining more advanced workflows and learn about different operators + +- [Running on multiple GPUs or on CPU](03-Running-on-multiple-GPUs-or-on-CPU.ipynb): Run NVTabular in different environments, such as multi-GPU or CPU-only mode. + +In addition, NVTabular is used in many of our examples in other Merlin libraries. You can explore more complex processing pipelines in following examples: + +- [End-To-End Examples with Merlin](https://github.com/NVIDIA-Merlin/Merlin/tree/stable/examples) +- [Training Examples with Merlin Models](https://github.com/NVIDIA-Merlin/models/tree/stable/examples) +- [Training Examples with Transformer4Rec](https://github.com/NVIDIA-Merlin/Transformers4Rec/tree/stable/examples) + +## Running the Example Notebooks + +You can run the example notebooks by [installing NVTabular](https://github.com/NVIDIA/NVTabular#installation) and other required libraries. Alternatively, Docker containers are available from the NVIDIA GPU Cloud (NGC) at with pre-installed versions. +Depending on which example you want to run, you should use any one of these Docker containers: + +- `merlin-hugectr` (contains NVTabular with HugeCTR) +- `merlin-tensorflow` (contains NVTabular with TensorFlow) +- `merlin-pytorch` (contains NVTabular with PyTorch) + +Beginning with the 22.06 release, each container includes the software for training models and performing inference. + +To run the example notebooks using Docker containers, perform the following steps: + +1. Pull and start the container by running the following command: + + ```shell + docker run --gpus all --rm -it \ + -p 8888:8888 -p 8797:8787 -p 8796:8786 --ipc=host \ + /bin/bash + ``` + + The container opens a shell when the run command execution is completed. + Your shell prompt should look similar to the following example: + + ```shell + root@2efa5b50b909: + ``` + +1. Start the JupyterLab server by running the following command: + + ```shell + jupyter-lab --allow-root --ip='0.0.0.0' + ``` + + View the messages in your terminal to identify the URL for JupyterLab. + The messages in your terminal show similar lines to the following example: + + ```shell + Or copy and paste one of these URLs: + http://2efa5b50b909:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d + or http://127.0.0.1:8888/lab?token=9b537d1fda9e4e9cadc673ba2a472e247deee69a6229ff8d + ``` + +1. Open a browser and use the `127.0.0.1` URL provided in the messages by JupyterLab. + +1. After you log in to JupyterLab, navigate to the `/nvtabular` directory to try out the example notebooks. + +## Troubleshooting + +If you experience any trouble running the example notebooks, check the latest [troubleshooting](https://nvidia-merlin.github.io/NVTabular/stable/resources/troubleshooting.html) documentation. diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.AddMetadata.rst b/review/pr-1877/_sources/generated/nvtabular.ops.AddMetadata.rst new file mode 100644 index 00000000000..86a90863ff9 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.AddMetadata.rst @@ -0,0 +1,49 @@ +nvtabular.ops.AddMetadata +========================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: AddMetadata + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~AddMetadata.__init__ + ~AddMetadata.column_mapping + ~AddMetadata.compute_column_schema + ~AddMetadata.compute_input_schema + ~AddMetadata.compute_output_schema + ~AddMetadata.compute_selector + ~AddMetadata.create_node + ~AddMetadata.export + ~AddMetadata.load_artifacts + ~AddMetadata.output_column_names + ~AddMetadata.save_artifacts + ~AddMetadata.transform + ~AddMetadata.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~AddMetadata.dependencies + ~AddMetadata.dynamic_dtypes + ~AddMetadata.export_name + ~AddMetadata.is_subgraph + ~AddMetadata.label + ~AddMetadata.output_dtype + ~AddMetadata.output_properties + ~AddMetadata.output_tags + ~AddMetadata.supported_formats + ~AddMetadata.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.AddProperties.rst b/review/pr-1877/_sources/generated/nvtabular.ops.AddProperties.rst new file mode 100644 index 00000000000..d64c47e44e5 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.AddProperties.rst @@ -0,0 +1,49 @@ +nvtabular.ops.AddProperties +=========================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: AddProperties + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~AddProperties.__init__ + ~AddProperties.column_mapping + ~AddProperties.compute_column_schema + ~AddProperties.compute_input_schema + ~AddProperties.compute_output_schema + ~AddProperties.compute_selector + ~AddProperties.create_node + ~AddProperties.export + ~AddProperties.load_artifacts + ~AddProperties.output_column_names + ~AddProperties.save_artifacts + ~AddProperties.transform + ~AddProperties.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~AddProperties.dependencies + ~AddProperties.dynamic_dtypes + ~AddProperties.export_name + ~AddProperties.is_subgraph + ~AddProperties.label + ~AddProperties.output_dtype + ~AddProperties.output_properties + ~AddProperties.output_tags + ~AddProperties.supported_formats + ~AddProperties.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.AddTags.rst b/review/pr-1877/_sources/generated/nvtabular.ops.AddTags.rst new file mode 100644 index 00000000000..a14b822c0f1 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.AddTags.rst @@ -0,0 +1,49 @@ +nvtabular.ops.AddTags +===================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: AddTags + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~AddTags.__init__ + ~AddTags.column_mapping + ~AddTags.compute_column_schema + ~AddTags.compute_input_schema + ~AddTags.compute_output_schema + ~AddTags.compute_selector + ~AddTags.create_node + ~AddTags.export + ~AddTags.load_artifacts + ~AddTags.output_column_names + ~AddTags.save_artifacts + ~AddTags.transform + ~AddTags.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~AddTags.dependencies + ~AddTags.dynamic_dtypes + ~AddTags.export_name + ~AddTags.is_subgraph + ~AddTags.label + ~AddTags.output_dtype + ~AddTags.output_properties + ~AddTags.output_tags + ~AddTags.supported_formats + ~AddTags.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Bucketize.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Bucketize.rst new file mode 100644 index 00000000000..7f1f8c637db --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Bucketize.rst @@ -0,0 +1,49 @@ +nvtabular.ops.Bucketize +======================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Bucketize + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Bucketize.__init__ + ~Bucketize.column_mapping + ~Bucketize.compute_column_schema + ~Bucketize.compute_input_schema + ~Bucketize.compute_output_schema + ~Bucketize.compute_selector + ~Bucketize.create_node + ~Bucketize.export + ~Bucketize.load_artifacts + ~Bucketize.output_column_names + ~Bucketize.save_artifacts + ~Bucketize.transform + ~Bucketize.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Bucketize.dependencies + ~Bucketize.dynamic_dtypes + ~Bucketize.export_name + ~Bucketize.is_subgraph + ~Bucketize.label + ~Bucketize.output_dtype + ~Bucketize.output_properties + ~Bucketize.output_tags + ~Bucketize.supported_formats + ~Bucketize.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Categorify.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Categorify.rst new file mode 100644 index 00000000000..97d14ceef34 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Categorify.rst @@ -0,0 +1,57 @@ +nvtabular.ops.Categorify +======================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Categorify + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Categorify.__init__ + ~Categorify.clear + ~Categorify.column_mapping + ~Categorify.compute_column_schema + ~Categorify.compute_input_schema + ~Categorify.compute_output_schema + ~Categorify.compute_selector + ~Categorify.create_node + ~Categorify.export + ~Categorify.fit + ~Categorify.fit_finalize + ~Categorify.get_embedding_sizes + ~Categorify.inference_initialize + ~Categorify.load_artifacts + ~Categorify.output_column_names + ~Categorify.process_vocabs + ~Categorify.save_artifacts + ~Categorify.set_storage_path + ~Categorify.transform + ~Categorify.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Categorify.dependencies + ~Categorify.dynamic_dtypes + ~Categorify.export_name + ~Categorify.fitted + ~Categorify.is_subgraph + ~Categorify.label + ~Categorify.output_dtype + ~Categorify.output_properties + ~Categorify.output_tags + ~Categorify.supported_formats + ~Categorify.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Clip.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Clip.rst new file mode 100644 index 00000000000..f56d88f6897 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Clip.rst @@ -0,0 +1,49 @@ +nvtabular.ops.Clip +================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Clip + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Clip.__init__ + ~Clip.column_mapping + ~Clip.compute_column_schema + ~Clip.compute_input_schema + ~Clip.compute_output_schema + ~Clip.compute_selector + ~Clip.create_node + ~Clip.export + ~Clip.load_artifacts + ~Clip.output_column_names + ~Clip.save_artifacts + ~Clip.transform + ~Clip.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Clip.dependencies + ~Clip.dynamic_dtypes + ~Clip.export_name + ~Clip.is_subgraph + ~Clip.label + ~Clip.output_dtype + ~Clip.output_properties + ~Clip.output_tags + ~Clip.supported_formats + ~Clip.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.ColumnSimilarity.rst b/review/pr-1877/_sources/generated/nvtabular.ops.ColumnSimilarity.rst new file mode 100644 index 00000000000..24784c8c998 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.ColumnSimilarity.rst @@ -0,0 +1,49 @@ +nvtabular.ops.ColumnSimilarity +============================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: ColumnSimilarity + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~ColumnSimilarity.__init__ + ~ColumnSimilarity.column_mapping + ~ColumnSimilarity.compute_column_schema + ~ColumnSimilarity.compute_input_schema + ~ColumnSimilarity.compute_output_schema + ~ColumnSimilarity.compute_selector + ~ColumnSimilarity.create_node + ~ColumnSimilarity.export + ~ColumnSimilarity.load_artifacts + ~ColumnSimilarity.output_column_names + ~ColumnSimilarity.save_artifacts + ~ColumnSimilarity.transform + ~ColumnSimilarity.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ColumnSimilarity.dependencies + ~ColumnSimilarity.dynamic_dtypes + ~ColumnSimilarity.export_name + ~ColumnSimilarity.is_subgraph + ~ColumnSimilarity.label + ~ColumnSimilarity.output_dtype + ~ColumnSimilarity.output_properties + ~ColumnSimilarity.output_tags + ~ColumnSimilarity.supported_formats + ~ColumnSimilarity.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.DifferenceLag.rst b/review/pr-1877/_sources/generated/nvtabular.ops.DifferenceLag.rst new file mode 100644 index 00000000000..71ffb1d22be --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.DifferenceLag.rst @@ -0,0 +1,49 @@ +nvtabular.ops.DifferenceLag +=========================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: DifferenceLag + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~DifferenceLag.__init__ + ~DifferenceLag.column_mapping + ~DifferenceLag.compute_column_schema + ~DifferenceLag.compute_input_schema + ~DifferenceLag.compute_output_schema + ~DifferenceLag.compute_selector + ~DifferenceLag.create_node + ~DifferenceLag.export + ~DifferenceLag.load_artifacts + ~DifferenceLag.output_column_names + ~DifferenceLag.save_artifacts + ~DifferenceLag.transform + ~DifferenceLag.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DifferenceLag.dependencies + ~DifferenceLag.dynamic_dtypes + ~DifferenceLag.export_name + ~DifferenceLag.is_subgraph + ~DifferenceLag.label + ~DifferenceLag.output_dtype + ~DifferenceLag.output_properties + ~DifferenceLag.output_tags + ~DifferenceLag.supported_formats + ~DifferenceLag.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.DropLowCardinality.rst b/review/pr-1877/_sources/generated/nvtabular.ops.DropLowCardinality.rst new file mode 100644 index 00000000000..1e9c4881fc1 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.DropLowCardinality.rst @@ -0,0 +1,49 @@ +nvtabular.ops.DropLowCardinality +================================ + +.. currentmodule:: nvtabular.ops + +.. autoclass:: DropLowCardinality + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~DropLowCardinality.__init__ + ~DropLowCardinality.column_mapping + ~DropLowCardinality.compute_column_schema + ~DropLowCardinality.compute_input_schema + ~DropLowCardinality.compute_output_schema + ~DropLowCardinality.compute_selector + ~DropLowCardinality.create_node + ~DropLowCardinality.export + ~DropLowCardinality.load_artifacts + ~DropLowCardinality.output_column_names + ~DropLowCardinality.save_artifacts + ~DropLowCardinality.transform + ~DropLowCardinality.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~DropLowCardinality.dependencies + ~DropLowCardinality.dynamic_dtypes + ~DropLowCardinality.export_name + ~DropLowCardinality.is_subgraph + ~DropLowCardinality.label + ~DropLowCardinality.output_dtype + ~DropLowCardinality.output_properties + ~DropLowCardinality.output_tags + ~DropLowCardinality.supported_formats + ~DropLowCardinality.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Dropna.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Dropna.rst new file mode 100644 index 00000000000..1159aec9062 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Dropna.rst @@ -0,0 +1,49 @@ +nvtabular.ops.Dropna +==================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Dropna + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Dropna.__init__ + ~Dropna.column_mapping + ~Dropna.compute_column_schema + ~Dropna.compute_input_schema + ~Dropna.compute_output_schema + ~Dropna.compute_selector + ~Dropna.create_node + ~Dropna.export + ~Dropna.load_artifacts + ~Dropna.output_column_names + ~Dropna.save_artifacts + ~Dropna.transform + ~Dropna.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Dropna.dependencies + ~Dropna.dynamic_dtypes + ~Dropna.export_name + ~Dropna.is_subgraph + ~Dropna.label + ~Dropna.output_dtype + ~Dropna.output_properties + ~Dropna.output_tags + ~Dropna.supported_formats + ~Dropna.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.FillMedian.rst b/review/pr-1877/_sources/generated/nvtabular.ops.FillMedian.rst new file mode 100644 index 00000000000..4a3ddd01bcf --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.FillMedian.rst @@ -0,0 +1,54 @@ +nvtabular.ops.FillMedian +======================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: FillMedian + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~FillMedian.__init__ + ~FillMedian.clear + ~FillMedian.column_mapping + ~FillMedian.compute_column_schema + ~FillMedian.compute_input_schema + ~FillMedian.compute_output_schema + ~FillMedian.compute_selector + ~FillMedian.create_node + ~FillMedian.export + ~FillMedian.fit + ~FillMedian.fit_finalize + ~FillMedian.load_artifacts + ~FillMedian.output_column_names + ~FillMedian.save_artifacts + ~FillMedian.set_storage_path + ~FillMedian.transform + ~FillMedian.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FillMedian.dependencies + ~FillMedian.dynamic_dtypes + ~FillMedian.export_name + ~FillMedian.fitted + ~FillMedian.is_subgraph + ~FillMedian.label + ~FillMedian.output_dtype + ~FillMedian.output_properties + ~FillMedian.output_tags + ~FillMedian.supported_formats + ~FillMedian.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.FillMissing.rst b/review/pr-1877/_sources/generated/nvtabular.ops.FillMissing.rst new file mode 100644 index 00000000000..b18627a0949 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.FillMissing.rst @@ -0,0 +1,50 @@ +nvtabular.ops.FillMissing +========================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: FillMissing + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~FillMissing.__init__ + ~FillMissing.column_mapping + ~FillMissing.compute_column_schema + ~FillMissing.compute_input_schema + ~FillMissing.compute_output_schema + ~FillMissing.compute_selector + ~FillMissing.create_node + ~FillMissing.export + ~FillMissing.inference_initialize + ~FillMissing.load_artifacts + ~FillMissing.output_column_names + ~FillMissing.save_artifacts + ~FillMissing.transform + ~FillMissing.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~FillMissing.dependencies + ~FillMissing.dynamic_dtypes + ~FillMissing.export_name + ~FillMissing.is_subgraph + ~FillMissing.label + ~FillMissing.output_dtype + ~FillMissing.output_properties + ~FillMissing.output_tags + ~FillMissing.supported_formats + ~FillMissing.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Filter.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Filter.rst new file mode 100644 index 00000000000..5f8182a9ce2 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Filter.rst @@ -0,0 +1,49 @@ +nvtabular.ops.Filter +==================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Filter + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Filter.__init__ + ~Filter.column_mapping + ~Filter.compute_column_schema + ~Filter.compute_input_schema + ~Filter.compute_output_schema + ~Filter.compute_selector + ~Filter.create_node + ~Filter.export + ~Filter.load_artifacts + ~Filter.output_column_names + ~Filter.save_artifacts + ~Filter.transform + ~Filter.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Filter.dependencies + ~Filter.dynamic_dtypes + ~Filter.export_name + ~Filter.is_subgraph + ~Filter.label + ~Filter.output_dtype + ~Filter.output_properties + ~Filter.output_tags + ~Filter.supported_formats + ~Filter.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Groupby.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Groupby.rst new file mode 100644 index 00000000000..3188c54b02d --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Groupby.rst @@ -0,0 +1,49 @@ +nvtabular.ops.Groupby +===================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Groupby + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Groupby.__init__ + ~Groupby.column_mapping + ~Groupby.compute_column_schema + ~Groupby.compute_input_schema + ~Groupby.compute_output_schema + ~Groupby.compute_selector + ~Groupby.create_node + ~Groupby.export + ~Groupby.load_artifacts + ~Groupby.output_column_names + ~Groupby.save_artifacts + ~Groupby.transform + ~Groupby.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Groupby.dependencies + ~Groupby.dynamic_dtypes + ~Groupby.export_name + ~Groupby.is_subgraph + ~Groupby.label + ~Groupby.output_dtype + ~Groupby.output_properties + ~Groupby.output_tags + ~Groupby.supported_formats + ~Groupby.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.HashBucket.rst b/review/pr-1877/_sources/generated/nvtabular.ops.HashBucket.rst new file mode 100644 index 00000000000..985e30a337e --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.HashBucket.rst @@ -0,0 +1,50 @@ +nvtabular.ops.HashBucket +======================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: HashBucket + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~HashBucket.__init__ + ~HashBucket.column_mapping + ~HashBucket.compute_column_schema + ~HashBucket.compute_input_schema + ~HashBucket.compute_output_schema + ~HashBucket.compute_selector + ~HashBucket.create_node + ~HashBucket.export + ~HashBucket.get_embedding_sizes + ~HashBucket.load_artifacts + ~HashBucket.output_column_names + ~HashBucket.save_artifacts + ~HashBucket.transform + ~HashBucket.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~HashBucket.dependencies + ~HashBucket.dynamic_dtypes + ~HashBucket.export_name + ~HashBucket.is_subgraph + ~HashBucket.label + ~HashBucket.output_dtype + ~HashBucket.output_properties + ~HashBucket.output_tags + ~HashBucket.supported_formats + ~HashBucket.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.HashedCross.rst b/review/pr-1877/_sources/generated/nvtabular.ops.HashedCross.rst new file mode 100644 index 00000000000..33be62d4534 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.HashedCross.rst @@ -0,0 +1,49 @@ +nvtabular.ops.HashedCross +========================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: HashedCross + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~HashedCross.__init__ + ~HashedCross.column_mapping + ~HashedCross.compute_column_schema + ~HashedCross.compute_input_schema + ~HashedCross.compute_output_schema + ~HashedCross.compute_selector + ~HashedCross.create_node + ~HashedCross.export + ~HashedCross.load_artifacts + ~HashedCross.output_column_names + ~HashedCross.save_artifacts + ~HashedCross.transform + ~HashedCross.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~HashedCross.dependencies + ~HashedCross.dynamic_dtypes + ~HashedCross.export_name + ~HashedCross.is_subgraph + ~HashedCross.label + ~HashedCross.output_dtype + ~HashedCross.output_properties + ~HashedCross.output_tags + ~HashedCross.supported_formats + ~HashedCross.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.JoinExternal.rst b/review/pr-1877/_sources/generated/nvtabular.ops.JoinExternal.rst new file mode 100644 index 00000000000..82000686798 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.JoinExternal.rst @@ -0,0 +1,49 @@ +nvtabular.ops.JoinExternal +========================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: JoinExternal + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~JoinExternal.__init__ + ~JoinExternal.column_mapping + ~JoinExternal.compute_column_schema + ~JoinExternal.compute_input_schema + ~JoinExternal.compute_output_schema + ~JoinExternal.compute_selector + ~JoinExternal.create_node + ~JoinExternal.export + ~JoinExternal.load_artifacts + ~JoinExternal.output_column_names + ~JoinExternal.save_artifacts + ~JoinExternal.transform + ~JoinExternal.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~JoinExternal.dependencies + ~JoinExternal.dynamic_dtypes + ~JoinExternal.export_name + ~JoinExternal.is_subgraph + ~JoinExternal.label + ~JoinExternal.output_dtype + ~JoinExternal.output_properties + ~JoinExternal.output_tags + ~JoinExternal.supported_formats + ~JoinExternal.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.JoinGroupby.rst b/review/pr-1877/_sources/generated/nvtabular.ops.JoinGroupby.rst new file mode 100644 index 00000000000..2874d35fa85 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.JoinGroupby.rst @@ -0,0 +1,55 @@ +nvtabular.ops.JoinGroupby +========================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: JoinGroupby + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~JoinGroupby.__init__ + ~JoinGroupby.clear + ~JoinGroupby.column_mapping + ~JoinGroupby.compute_column_schema + ~JoinGroupby.compute_input_schema + ~JoinGroupby.compute_output_schema + ~JoinGroupby.compute_selector + ~JoinGroupby.create_node + ~JoinGroupby.export + ~JoinGroupby.fit + ~JoinGroupby.fit_finalize + ~JoinGroupby.load_artifacts + ~JoinGroupby.output_column_names + ~JoinGroupby.save_artifacts + ~JoinGroupby.set_storage_path + ~JoinGroupby.transform + ~JoinGroupby.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~JoinGroupby.cont_names + ~JoinGroupby.dependencies + ~JoinGroupby.dynamic_dtypes + ~JoinGroupby.export_name + ~JoinGroupby.fitted + ~JoinGroupby.is_subgraph + ~JoinGroupby.label + ~JoinGroupby.output_dtype + ~JoinGroupby.output_properties + ~JoinGroupby.output_tags + ~JoinGroupby.supported_formats + ~JoinGroupby.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.LambdaOp.rst b/review/pr-1877/_sources/generated/nvtabular.ops.LambdaOp.rst new file mode 100644 index 00000000000..376d7359847 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.LambdaOp.rst @@ -0,0 +1,49 @@ +nvtabular.ops.LambdaOp +====================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: LambdaOp + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~LambdaOp.__init__ + ~LambdaOp.column_mapping + ~LambdaOp.compute_column_schema + ~LambdaOp.compute_input_schema + ~LambdaOp.compute_output_schema + ~LambdaOp.compute_selector + ~LambdaOp.create_node + ~LambdaOp.export + ~LambdaOp.load_artifacts + ~LambdaOp.output_column_names + ~LambdaOp.save_artifacts + ~LambdaOp.transform + ~LambdaOp.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~LambdaOp.dependencies + ~LambdaOp.dynamic_dtypes + ~LambdaOp.export_name + ~LambdaOp.is_subgraph + ~LambdaOp.label + ~LambdaOp.output_dtype + ~LambdaOp.output_properties + ~LambdaOp.output_tags + ~LambdaOp.supported_formats + ~LambdaOp.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.ListSlice.rst b/review/pr-1877/_sources/generated/nvtabular.ops.ListSlice.rst new file mode 100644 index 00000000000..8361c040a24 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.ListSlice.rst @@ -0,0 +1,49 @@ +nvtabular.ops.ListSlice +======================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: ListSlice + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~ListSlice.__init__ + ~ListSlice.column_mapping + ~ListSlice.compute_column_schema + ~ListSlice.compute_input_schema + ~ListSlice.compute_output_schema + ~ListSlice.compute_selector + ~ListSlice.create_node + ~ListSlice.export + ~ListSlice.load_artifacts + ~ListSlice.output_column_names + ~ListSlice.save_artifacts + ~ListSlice.transform + ~ListSlice.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ListSlice.dependencies + ~ListSlice.dynamic_dtypes + ~ListSlice.export_name + ~ListSlice.is_subgraph + ~ListSlice.label + ~ListSlice.output_dtype + ~ListSlice.output_properties + ~ListSlice.output_tags + ~ListSlice.supported_formats + ~ListSlice.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.LogOp.rst b/review/pr-1877/_sources/generated/nvtabular.ops.LogOp.rst new file mode 100644 index 00000000000..8ca00401efc --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.LogOp.rst @@ -0,0 +1,49 @@ +nvtabular.ops.LogOp +=================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: LogOp + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~LogOp.__init__ + ~LogOp.column_mapping + ~LogOp.compute_column_schema + ~LogOp.compute_input_schema + ~LogOp.compute_output_schema + ~LogOp.compute_selector + ~LogOp.create_node + ~LogOp.export + ~LogOp.load_artifacts + ~LogOp.output_column_names + ~LogOp.save_artifacts + ~LogOp.transform + ~LogOp.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~LogOp.dependencies + ~LogOp.dynamic_dtypes + ~LogOp.export_name + ~LogOp.is_subgraph + ~LogOp.label + ~LogOp.output_dtype + ~LogOp.output_properties + ~LogOp.output_tags + ~LogOp.supported_formats + ~LogOp.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Normalize.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Normalize.rst new file mode 100644 index 00000000000..b98b17508f5 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Normalize.rst @@ -0,0 +1,54 @@ +nvtabular.ops.Normalize +======================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Normalize + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Normalize.__init__ + ~Normalize.clear + ~Normalize.column_mapping + ~Normalize.compute_column_schema + ~Normalize.compute_input_schema + ~Normalize.compute_output_schema + ~Normalize.compute_selector + ~Normalize.create_node + ~Normalize.export + ~Normalize.fit + ~Normalize.fit_finalize + ~Normalize.load_artifacts + ~Normalize.output_column_names + ~Normalize.save_artifacts + ~Normalize.set_storage_path + ~Normalize.transform + ~Normalize.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Normalize.dependencies + ~Normalize.dynamic_dtypes + ~Normalize.export_name + ~Normalize.fitted + ~Normalize.is_subgraph + ~Normalize.label + ~Normalize.output_dtype + ~Normalize.output_properties + ~Normalize.output_tags + ~Normalize.supported_formats + ~Normalize.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.NormalizeMinMax.rst b/review/pr-1877/_sources/generated/nvtabular.ops.NormalizeMinMax.rst new file mode 100644 index 00000000000..588b8cfafb3 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.NormalizeMinMax.rst @@ -0,0 +1,54 @@ +nvtabular.ops.NormalizeMinMax +============================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: NormalizeMinMax + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~NormalizeMinMax.__init__ + ~NormalizeMinMax.clear + ~NormalizeMinMax.column_mapping + ~NormalizeMinMax.compute_column_schema + ~NormalizeMinMax.compute_input_schema + ~NormalizeMinMax.compute_output_schema + ~NormalizeMinMax.compute_selector + ~NormalizeMinMax.create_node + ~NormalizeMinMax.export + ~NormalizeMinMax.fit + ~NormalizeMinMax.fit_finalize + ~NormalizeMinMax.load_artifacts + ~NormalizeMinMax.output_column_names + ~NormalizeMinMax.save_artifacts + ~NormalizeMinMax.set_storage_path + ~NormalizeMinMax.transform + ~NormalizeMinMax.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~NormalizeMinMax.dependencies + ~NormalizeMinMax.dynamic_dtypes + ~NormalizeMinMax.export_name + ~NormalizeMinMax.fitted + ~NormalizeMinMax.is_subgraph + ~NormalizeMinMax.label + ~NormalizeMinMax.output_dtype + ~NormalizeMinMax.output_properties + ~NormalizeMinMax.output_tags + ~NormalizeMinMax.supported_formats + ~NormalizeMinMax.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Operator.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Operator.rst new file mode 100644 index 00000000000..2d43fa8c124 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Operator.rst @@ -0,0 +1,49 @@ +nvtabular.ops.Operator +====================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Operator + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Operator.__init__ + ~Operator.column_mapping + ~Operator.compute_column_schema + ~Operator.compute_input_schema + ~Operator.compute_output_schema + ~Operator.compute_selector + ~Operator.create_node + ~Operator.export + ~Operator.load_artifacts + ~Operator.output_column_names + ~Operator.save_artifacts + ~Operator.transform + ~Operator.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Operator.dependencies + ~Operator.dynamic_dtypes + ~Operator.export_name + ~Operator.is_subgraph + ~Operator.label + ~Operator.output_dtype + ~Operator.output_properties + ~Operator.output_tags + ~Operator.supported_formats + ~Operator.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.ReduceDtypeSize.rst b/review/pr-1877/_sources/generated/nvtabular.ops.ReduceDtypeSize.rst new file mode 100644 index 00000000000..609291ea2be --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.ReduceDtypeSize.rst @@ -0,0 +1,54 @@ +nvtabular.ops.ReduceDtypeSize +============================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: ReduceDtypeSize + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~ReduceDtypeSize.__init__ + ~ReduceDtypeSize.clear + ~ReduceDtypeSize.column_mapping + ~ReduceDtypeSize.compute_column_schema + ~ReduceDtypeSize.compute_input_schema + ~ReduceDtypeSize.compute_output_schema + ~ReduceDtypeSize.compute_selector + ~ReduceDtypeSize.create_node + ~ReduceDtypeSize.export + ~ReduceDtypeSize.fit + ~ReduceDtypeSize.fit_finalize + ~ReduceDtypeSize.load_artifacts + ~ReduceDtypeSize.output_column_names + ~ReduceDtypeSize.save_artifacts + ~ReduceDtypeSize.set_storage_path + ~ReduceDtypeSize.transform + ~ReduceDtypeSize.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ReduceDtypeSize.dependencies + ~ReduceDtypeSize.dynamic_dtypes + ~ReduceDtypeSize.export_name + ~ReduceDtypeSize.fitted + ~ReduceDtypeSize.is_subgraph + ~ReduceDtypeSize.label + ~ReduceDtypeSize.output_dtype + ~ReduceDtypeSize.output_properties + ~ReduceDtypeSize.output_tags + ~ReduceDtypeSize.supported_formats + ~ReduceDtypeSize.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.Rename.rst b/review/pr-1877/_sources/generated/nvtabular.ops.Rename.rst new file mode 100644 index 00000000000..11b3a43e689 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.Rename.rst @@ -0,0 +1,49 @@ +nvtabular.ops.Rename +==================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: Rename + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Rename.__init__ + ~Rename.column_mapping + ~Rename.compute_column_schema + ~Rename.compute_input_schema + ~Rename.compute_output_schema + ~Rename.compute_selector + ~Rename.create_node + ~Rename.export + ~Rename.load_artifacts + ~Rename.output_column_names + ~Rename.save_artifacts + ~Rename.transform + ~Rename.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Rename.dependencies + ~Rename.dynamic_dtypes + ~Rename.export_name + ~Rename.is_subgraph + ~Rename.label + ~Rename.output_dtype + ~Rename.output_properties + ~Rename.output_tags + ~Rename.supported_formats + ~Rename.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.StatOperator.rst b/review/pr-1877/_sources/generated/nvtabular.ops.StatOperator.rst new file mode 100644 index 00000000000..174621db79f --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.StatOperator.rst @@ -0,0 +1,54 @@ +nvtabular.ops.StatOperator +========================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: StatOperator + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~StatOperator.__init__ + ~StatOperator.clear + ~StatOperator.column_mapping + ~StatOperator.compute_column_schema + ~StatOperator.compute_input_schema + ~StatOperator.compute_output_schema + ~StatOperator.compute_selector + ~StatOperator.create_node + ~StatOperator.export + ~StatOperator.fit + ~StatOperator.fit_finalize + ~StatOperator.load_artifacts + ~StatOperator.output_column_names + ~StatOperator.save_artifacts + ~StatOperator.set_storage_path + ~StatOperator.transform + ~StatOperator.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~StatOperator.dependencies + ~StatOperator.dynamic_dtypes + ~StatOperator.export_name + ~StatOperator.fitted + ~StatOperator.is_subgraph + ~StatOperator.label + ~StatOperator.output_dtype + ~StatOperator.output_properties + ~StatOperator.output_tags + ~StatOperator.supported_formats + ~StatOperator.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.TagAsItemFeatures.rst b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsItemFeatures.rst new file mode 100644 index 00000000000..70fb48cd74c --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsItemFeatures.rst @@ -0,0 +1,49 @@ +nvtabular.ops.TagAsItemFeatures +=============================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: TagAsItemFeatures + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~TagAsItemFeatures.__init__ + ~TagAsItemFeatures.column_mapping + ~TagAsItemFeatures.compute_column_schema + ~TagAsItemFeatures.compute_input_schema + ~TagAsItemFeatures.compute_output_schema + ~TagAsItemFeatures.compute_selector + ~TagAsItemFeatures.create_node + ~TagAsItemFeatures.export + ~TagAsItemFeatures.load_artifacts + ~TagAsItemFeatures.output_column_names + ~TagAsItemFeatures.save_artifacts + ~TagAsItemFeatures.transform + ~TagAsItemFeatures.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TagAsItemFeatures.dependencies + ~TagAsItemFeatures.dynamic_dtypes + ~TagAsItemFeatures.export_name + ~TagAsItemFeatures.is_subgraph + ~TagAsItemFeatures.label + ~TagAsItemFeatures.output_dtype + ~TagAsItemFeatures.output_properties + ~TagAsItemFeatures.output_tags + ~TagAsItemFeatures.supported_formats + ~TagAsItemFeatures.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.TagAsItemID.rst b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsItemID.rst new file mode 100644 index 00000000000..8cfb2dad6b9 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsItemID.rst @@ -0,0 +1,49 @@ +nvtabular.ops.TagAsItemID +========================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: TagAsItemID + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~TagAsItemID.__init__ + ~TagAsItemID.column_mapping + ~TagAsItemID.compute_column_schema + ~TagAsItemID.compute_input_schema + ~TagAsItemID.compute_output_schema + ~TagAsItemID.compute_selector + ~TagAsItemID.create_node + ~TagAsItemID.export + ~TagAsItemID.load_artifacts + ~TagAsItemID.output_column_names + ~TagAsItemID.save_artifacts + ~TagAsItemID.transform + ~TagAsItemID.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TagAsItemID.dependencies + ~TagAsItemID.dynamic_dtypes + ~TagAsItemID.export_name + ~TagAsItemID.is_subgraph + ~TagAsItemID.label + ~TagAsItemID.output_dtype + ~TagAsItemID.output_properties + ~TagAsItemID.output_tags + ~TagAsItemID.supported_formats + ~TagAsItemID.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.TagAsUserFeatures.rst b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsUserFeatures.rst new file mode 100644 index 00000000000..ed2c8a9d704 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsUserFeatures.rst @@ -0,0 +1,49 @@ +nvtabular.ops.TagAsUserFeatures +=============================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: TagAsUserFeatures + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~TagAsUserFeatures.__init__ + ~TagAsUserFeatures.column_mapping + ~TagAsUserFeatures.compute_column_schema + ~TagAsUserFeatures.compute_input_schema + ~TagAsUserFeatures.compute_output_schema + ~TagAsUserFeatures.compute_selector + ~TagAsUserFeatures.create_node + ~TagAsUserFeatures.export + ~TagAsUserFeatures.load_artifacts + ~TagAsUserFeatures.output_column_names + ~TagAsUserFeatures.save_artifacts + ~TagAsUserFeatures.transform + ~TagAsUserFeatures.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TagAsUserFeatures.dependencies + ~TagAsUserFeatures.dynamic_dtypes + ~TagAsUserFeatures.export_name + ~TagAsUserFeatures.is_subgraph + ~TagAsUserFeatures.label + ~TagAsUserFeatures.output_dtype + ~TagAsUserFeatures.output_properties + ~TagAsUserFeatures.output_tags + ~TagAsUserFeatures.supported_formats + ~TagAsUserFeatures.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.TagAsUserID.rst b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsUserID.rst new file mode 100644 index 00000000000..bb633ed873b --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.TagAsUserID.rst @@ -0,0 +1,49 @@ +nvtabular.ops.TagAsUserID +========================= + +.. currentmodule:: nvtabular.ops + +.. autoclass:: TagAsUserID + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~TagAsUserID.__init__ + ~TagAsUserID.column_mapping + ~TagAsUserID.compute_column_schema + ~TagAsUserID.compute_input_schema + ~TagAsUserID.compute_output_schema + ~TagAsUserID.compute_selector + ~TagAsUserID.create_node + ~TagAsUserID.export + ~TagAsUserID.load_artifacts + ~TagAsUserID.output_column_names + ~TagAsUserID.save_artifacts + ~TagAsUserID.transform + ~TagAsUserID.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TagAsUserID.dependencies + ~TagAsUserID.dynamic_dtypes + ~TagAsUserID.export_name + ~TagAsUserID.is_subgraph + ~TagAsUserID.label + ~TagAsUserID.output_dtype + ~TagAsUserID.output_properties + ~TagAsUserID.output_tags + ~TagAsUserID.supported_formats + ~TagAsUserID.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.TargetEncoding.rst b/review/pr-1877/_sources/generated/nvtabular.ops.TargetEncoding.rst new file mode 100644 index 00000000000..3d259475853 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.TargetEncoding.rst @@ -0,0 +1,55 @@ +nvtabular.ops.TargetEncoding +============================ + +.. currentmodule:: nvtabular.ops + +.. autoclass:: TargetEncoding + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~TargetEncoding.__init__ + ~TargetEncoding.clear + ~TargetEncoding.column_mapping + ~TargetEncoding.compute_column_schema + ~TargetEncoding.compute_input_schema + ~TargetEncoding.compute_output_schema + ~TargetEncoding.compute_selector + ~TargetEncoding.create_node + ~TargetEncoding.export + ~TargetEncoding.fit + ~TargetEncoding.fit_finalize + ~TargetEncoding.load_artifacts + ~TargetEncoding.output_column_names + ~TargetEncoding.save_artifacts + ~TargetEncoding.set_storage_path + ~TargetEncoding.transform + ~TargetEncoding.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~TargetEncoding.dependencies + ~TargetEncoding.dynamic_dtypes + ~TargetEncoding.export_name + ~TargetEncoding.fitted + ~TargetEncoding.is_subgraph + ~TargetEncoding.label + ~TargetEncoding.output_dtype + ~TargetEncoding.output_properties + ~TargetEncoding.output_tags + ~TargetEncoding.supported_formats + ~TargetEncoding.supports + ~TargetEncoding.target_columns + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.ops.ValueCount.rst b/review/pr-1877/_sources/generated/nvtabular.ops.ValueCount.rst new file mode 100644 index 00000000000..6dde5db6011 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.ops.ValueCount.rst @@ -0,0 +1,54 @@ +nvtabular.ops.ValueCount +======================== + +.. currentmodule:: nvtabular.ops + +.. autoclass:: ValueCount + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~ValueCount.__init__ + ~ValueCount.clear + ~ValueCount.column_mapping + ~ValueCount.compute_column_schema + ~ValueCount.compute_input_schema + ~ValueCount.compute_output_schema + ~ValueCount.compute_selector + ~ValueCount.create_node + ~ValueCount.export + ~ValueCount.fit + ~ValueCount.fit_finalize + ~ValueCount.load_artifacts + ~ValueCount.output_column_names + ~ValueCount.save_artifacts + ~ValueCount.set_storage_path + ~ValueCount.transform + ~ValueCount.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ValueCount.dependencies + ~ValueCount.dynamic_dtypes + ~ValueCount.export_name + ~ValueCount.fitted + ~ValueCount.is_subgraph + ~ValueCount.label + ~ValueCount.output_dtype + ~ValueCount.output_properties + ~ValueCount.output_tags + ~ValueCount.supported_formats + ~ValueCount.supports + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.workflow.workflow.Workflow.rst b/review/pr-1877/_sources/generated/nvtabular.workflow.workflow.Workflow.rst new file mode 100644 index 00000000000..7ea2be457f7 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.workflow.workflow.Workflow.rst @@ -0,0 +1,42 @@ +nvtabular.workflow.workflow.Workflow +==================================== + +.. currentmodule:: nvtabular.workflow.workflow + +.. autoclass:: Workflow + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Workflow.__init__ + ~Workflow.clear_stats + ~Workflow.fit + ~Workflow.fit_schema + ~Workflow.fit_transform + ~Workflow.get_subworkflow + ~Workflow.load + ~Workflow.remove_inputs + ~Workflow.save + ~Workflow.transform + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Workflow.input_dtypes + ~Workflow.input_schema + ~Workflow.output_dtypes + ~Workflow.output_node + ~Workflow.output_schema + ~Workflow.subworkflows + + \ No newline at end of file diff --git a/review/pr-1877/_sources/generated/nvtabular.workflow.workflow.WorkflowNode.rst b/review/pr-1877/_sources/generated/nvtabular.workflow.workflow.WorkflowNode.rst new file mode 100644 index 00000000000..d54cf3a91f9 --- /dev/null +++ b/review/pr-1877/_sources/generated/nvtabular.workflow.workflow.WorkflowNode.rst @@ -0,0 +1,47 @@ +nvtabular.workflow.workflow.WorkflowNode +======================================== + +.. currentmodule:: nvtabular.workflow.workflow + +.. autoclass:: WorkflowNode + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~WorkflowNode.__init__ + ~WorkflowNode.add_child + ~WorkflowNode.add_dependency + ~WorkflowNode.add_parent + ~WorkflowNode.compute_schemas + ~WorkflowNode.construct_from + ~WorkflowNode.export + ~WorkflowNode.exportable + ~WorkflowNode.remove_child + ~WorkflowNode.remove_inputs + ~WorkflowNode.validate_schemas + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~WorkflowNode.column_mapping + ~WorkflowNode.dependency_columns + ~WorkflowNode.export_name + ~WorkflowNode.graph + ~WorkflowNode.grouped_parents_with_dependencies + ~WorkflowNode.input_columns + ~WorkflowNode.label + ~WorkflowNode.output_columns + ~WorkflowNode.parents_with_dependencies + ~WorkflowNode.selector + + \ No newline at end of file diff --git a/review/pr-1877/_sources/index.rst b/review/pr-1877/_sources/index.rst new file mode 100644 index 00000000000..3fd2ba95bb4 --- /dev/null +++ b/review/pr-1877/_sources/index.rst @@ -0,0 +1,27 @@ +Merlin NVTabular +================ + +The Merlin NVTabular library provides feature engineering and preprocessing for tabular data. +The library enables you to manipulate datasets easily for training deep-learning recommender systems. + +To learn more, start with the `Introduction `_. + +Related Resources +----------------- + +Merlin NVTabular GitHub Repository + ``_ + +About Merlin + Merlin is the overarching project that brings together the Merlin projects. + See the `documentation `_ + or the `repository `_ on GitHub. + +Developer website for Merlin + More information about Merlin is available at our developer website: + ``_. + +Index +----- + +* :ref:`genindex` diff --git a/review/pr-1877/_sources/resources/architecture.md b/review/pr-1877/_sources/resources/architecture.md new file mode 100644 index 00000000000..e1df02d4301 --- /dev/null +++ b/review/pr-1877/_sources/resources/architecture.md @@ -0,0 +1,75 @@ +# Architecture + +The NVTabular engine uses the [RAPIDS](http://www.rapids.ai) [Dask-cuDF library](https://github.com/rapidsai/dask-cuda), which provides the bulk of the functionality for accelerating dataframe operations on the GPU and scaling across multiple GPUs. NVTabular provides functionality commonly found in deep learning recommendation workflows, allowing you to focus on what you want to do with your data, and not how you need to do it. NVTabular also provides a template for our core compute mechanism, which is referred to as Operations (ops), allowing you to build your own custom ops from cuDF and other libraries. + +Once NVTabular is installed, the next step is to define the preprocessing and feature engineering pipeline by applying the ops that you need. For additional information about installing NVTabular, see [Installation](https://nvidia-merlin.github.io/NVTabular/stable/Introduction.html#installation). + +## Operations + +Operations are a reflection of the way in which compute happens on the GPU across large datasets. There are two types of compute: + +- the type that touches the entire dataset (or some large chunk of it) +- the type that operates on a single row + +Operations split the compute into two phases: + +- Statistics Gathering is the first phase where operations that cross the row boundary can occur. An example of this would be in the Normalize op that relies on two statistics: mean and standard deviation. To normalize a row, we must first have these two values calculated using a Dask-cudf graph. +- Transform is the second phase that uses the statistics, which were created earlier, to modify the dataset and transform the data. NVTabular allows for the application of transforms, which doesn't only take place during the modification of the dataset but also during dataloading. The same transforms can also be applied with Inference. + +NVTabular's preprocessing and feature engineering workflows are directed graphs of operators, which are applied to user defined groups of columns. Defining this graph is decoupled from the Workflow class, and lets users easily define complicated graphs of operations on their own custom defined sets of columns. The NVTabular workflow uses an API similar to the one noted on [scikit-learn](https://scikit-learn.org/stable/data_transforms.html) for dataset transformations. Statistics are calculated using a 'fit' method and applied with a 'transform' method. The NVTabular Dataset object can handle both the input and output for datasets using the ‘transform’ method of the workflow, taking an input dataset and returning it as output in the form of a transformed dataset. + +An operator can be applied to a ColumnGroup from an overloaded operator (>>), which returns a new ColumnGroup so that more operators can be applied to it as shown in the example below. A ColumnGroup is a list of column name strings. The operators work on every column in the ColumnGroup. In the example below, CONT_COLUMNS represents a group of columns for continuous features. We can apply multiple operators by chaining them to CONT_COLUMNS to obtain transformed continuous features. + +```python +CONT_COLUMNS = ['col1 name', 'col2 name', ...] +cont_features = CONT_COLUMNS >> >> >> ... +``` + +## A Higher Level of Abstraction + +The NVTabular code is targeted at the operator level and not the dataframe level, which provides a method for specifying the operation that you want to perform, as well as the columns or type of data that you want to perform it on. There are two types of operators: + +- Base Operator: It transforms columns using a transform method that processes the cudf dataframe object and a list of columns and returns the transformed cudf dataframe object. It also declares the columns that are produced using the ‘output_columns_names’ method and additional column groups using the ‘dependencies’ method. +- StatOperator: A subclass that uses a 'fit' method to calculate statistics on a dataframe, a 'finalize' method to combine different statistics from various dask workers, and save/load methods to handle serialization. + +A flexible method is used for defining the operators in the workflow, which is treated as a directed acyclic graph of operators on a set of columns. Operators take in identical types of column sets and perform the operation across each column in which the output is transformed during the final operation into a long tensor for categorical variables or float tensor for continuous variables. Operators can be chained to allow for more complex feature engineering or preprocessing. Chaining operators to the ColumnGroup defines the graph, which is necessary to produce the output dataset. The chained operators replace the chained columns by transforming the columns while retaining the same column names. + +Here's a holistic processing workflow example: + +```python +import nvtabular as nvt +from nvtabular import ops + +# define set of columns +cat_columns = ["user_id", "item_id", "city"], +cont_columns = ["age", "time_of_day", "item_num_views"], +label_column = ["label"] + +# by default, the op will be applied to all +# columns of the each ColumnGroup +cat_features = cat_columns >> ops.Categorify() +cont_features = cont_columns >> ops.FillMissing() >> ops.Normalize() +label_feature = label_column >> ops.LogOp() + +# A NVTabular workflow orchastrates the pipelines +# We create the NVTabular workflow with the output ColumnGroups +proc = nvt.Workflow(cat_features + cont_features + label_feature) + +dataset = nvt.Dataset("/path/to/data.parquet") +# Calculate statistics on the training set +proc.fit(dataset) + +# record stats, transform the dataset, and export +# the transformed data to a parquet file +proc.transform(dataset).to_parquet(output_path="/path/to/export/dir", shuffle=nvt.io.Shuffle.PER_WORKER) +``` + +We can easily convert this workflow definition into a graph, and visualize the full workflow by concatenating the output ColumnGroups. + +``` +(cat_features+cont_features+label_feature).graph +``` + +![NVTabular Workflow Graph](/images/nvt_workflow_graph.png) + +The Rename operator can be used to change the names of columns. This operator provides several different options for renaming columns such as applying a user defined function to get new column names, as well as appending a suffix to each column. Refer to the API documentation for the {class}`Rename ` operator. diff --git a/review/pr-1877/_sources/resources/cloud_integration.md b/review/pr-1877/_sources/resources/cloud_integration.md new file mode 100644 index 00000000000..65e9d62f2fd --- /dev/null +++ b/review/pr-1877/_sources/resources/cloud_integration.md @@ -0,0 +1,218 @@ +# Cloud Integration + +```{contents} +--- +depth: 1 +local: true +backlinks: none +--- +``` + +## Amazon Web Services + +Amazon Web Services (AWS) offers [EC2 instances with NVIDIA GPU support](https://aws.amazon.com/ec2/instance-types/#Accelerated_Computing). NVTabular can be used with 1x, 4x, or 8x GPU instances or multiple nodes. We're using an EC2 instance with 8x NVIDIA A100 GPUs to demonstrate the steps below. Check out the $/h for this instance type and adjust the type. + +To run NVTabular on the cloud using AWS, do the following: + +1. Start the AWS EC2 instance with the [NVIDIA Deep Learning AMI image](https://aws.amazon.com/marketplace/pp/NVIDIA-NVIDIA-Deep-Learning-AMI/B076K31M1S) using the aws-cli. + + ``` + # Starts the P4D instance with 8x NVIDIA A100 GPUs (take a look at the $/h for this instance type before using them) + aws ec2 run-instances --image-id ami-04c0416d6bd8e4b1f --count 1 --instance-type p4d.24xlarge --key-name --security-groups + ``` + +2. SSH into the machine. + +3. Create a RAID volume by running the following command: + + Depending on the EC2 instance, the machine may include local disk storage. We can optimize the performance by creating a + [RAID volume](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/raid-config.html). Based on our experience, two NVMe volumes yield the best performance. + + ``` + sudo mdadm --create --verbose /dev/md0 --level=0 --name=MY_RAID --raid-devices=2 /dev/nvme1n1 /dev/nvme2n1 + + sudo mkfs.ext4 -L MY_RAID /dev/md0 + sudo mkdir -p /mnt/raid + sudo mount LABEL=MY_RAID /mnt/raid + + sudo chmod -R 777 /mnt/raid + + # Copy dataset inside raid directory: + cp -r data/ /mnt/raid/data/ + ``` + +4. Launch the NVTabular Docker container by running the following command: + + ``` + docker run --gpus all --rm -it -p 8888:8888 -p 8797:8787 -p 8796:8786 --ipc=host --cap-add SYS_PTRACE -v /mnt/raid:/raid nvcr.io/nvidia/nvtabular:0.3 /bin/bash + ``` + +5. Start the jupyter-lab server by running the following command: + ``` + jupyter-lab --allow-root --ip='0.0.0.0' --NotebookApp.token='' + ``` + +## Google Cloud Platform + +The Google Cloud Platform (GCP) offers [Compute Engine instances with NVIDIA GPU support](https://cloud.google.com/compute/docs/gpus). We're using a VM with 8x NVIDIA A100 GPUs and eight local SSD-NVMe devices configured as RAID 0 to demonstrate the steps below. + +To run NVTabular on the cloud using GCP, do the following: + +1. Configure and create the VM as follows: + + - **GPU**: 8xA100 (a2-highgpu-8g) + - **Boot Disk**: Ubuntu version 18.04 + - **Storage**: Local 8xSSD-NVMe + +2. Install the NVIDIA drivers and CUDA by running the following commands: + + ```shell + curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin + sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 + sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" + sudo apt -y update + sudo apt -y install cuda + nvidia-smi # Check installation + ``` + + > For more information, refer to [Install GPU drivers](https://cloud.google.com/compute/docs/gpus/install-drivers-gpu) + > in the Google Cloud documentation. + +3. [Install Docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html) by running the following commands: + + ```shell + distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ + && curl -s -L https://nvidia-merlin.github.io/nvidia-docker/gpgkey | sudo apt-key add - \ + && curl -s -L https://nvidia-merlin.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list + sudo apt-get -y update + sudo apt-get install -y nvidia-docker2 + sudo systemctl restart docker + sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi # Check Installation + ``` + +4. Configure the storage as RAID 0 by running the following commands: + + ```shell + sudo mdadm --create --verbose /dev/md0 --level=0 --name=MY_RAID --raid-devices=2 /dev/nvme0n1 /dev/nvme0n2 + sudo mkfs.ext4 -L MY_RAID /dev/md0 + sudo mkdir -p /mnt/raid + sudo mount LABEL=MY_RAID /mnt/raid + sudo chmod -R 777 /mnt/raid + + # Copy data to RAID + cp -r data/ /mnt/raid/data/ + ``` + +5. Run the container by running the following command: + + ```shell + docker run --gpus all --rm -it -p 8888:8888 -p 8797:8787 -p 8796:8786 --ipc=host --cap-add SYS_PTRACE -v /mnt/raid:/raid nvcr.io/nvidia/nvtabular:0.3 /bin/bash + ``` + +## Databricks + +Databricks has developed a web-based platform on top of Apache Spark to provide automated cluster management. Databricks currently supports [custom containers](https://docs.databricks.com/clusters/custom-containers.html) + +To run NVTabular on Databricks, do the following: + +1. Create a custom NVTabular container using Databricks runtime. + + **NOTE**: If any of the default dependencies that come with the Databricks cluster are changed to a different version, the Databricks cluster won't be able to detect the Spark + driver. As a workaround, the NVIDIA RAPIDS team has created a + [Docker container](https://github.com/rapidsai/cloud-ml-examples/tree/main/databricks/docker) so that RAPIDS can run inside a Databricks cluster. + +2. Extend the container and add NVTabular and PyTorch so that they can run inside Databricks. + +3. Select the appropriate version of the NVTabular Conda repo. + + **NOTE**: All versions of the NVTabular conda repo are listed [here](https://anaconda.org/nvidia/nvtabular/files?version=). + +4. Clone the cloud-ml-example repo by running the following command: + + ``` + git clone https://github.com/rapidsai/cloud-ml-examples.git + ``` + +5. Add the selected version of the NVTabular Conda repo to the [rapids-spec.txt](https://github.com/rapidsai/cloud-ml-examples/blob/main/databricks/docker/rapids-spec.txt) file by + running the following command: + + ``` + cd databricks + echo "https://conda.anaconda.org/nvidia/linux-64/nvtabular-0.6.1-py38_0.tar.bz2" >> docker/rapids-spec.txt + ``` + +6. To install PyTorch, add the fastai pip package install to the Dockerfile by running the following command: + + ``` + RUN pip install fastai + ``` + +7. Build the container and push it to Docker Hub or the AWS Elastic Container Registry by running the following command: + + ``` + docker build --tag /databricks_nvtabular:latest docker push /databricks_nvtabular:latest + ``` + +8. Use the custom container to spin up the Databricks cluster. + + ![Databricks NVTabular](/images/nvt_databricks.png) + +9. Select a GPU node for the Worker and Driver. + Once the Databricks cluster is up, NVTabular will be running inside of it. + +## AWS SageMaker + +[AWS SageMaker](https://aws.amazon.com/sagemaker/) is a service from AWS to "build, train and deploy machine learning" models. It automates and manages the MLOps workflow. It supports jupyter notebook instances enabling users to work directly in jupyter notebook/jupyter lab without any additional configurations. In this section, we will explain how to run NVIDIA Merlin (NVTabular) on AWS SageMaker notebook instances. We adopted the work from [Eugene](https://twitter.com/eugeneyan/) from his [twitter post](https://twitter.com/eugeneyan/status/1470916049604268035). We tested the workflow on February, 1st, 2022, but it is not integrated into our CI workflows. Future release of Merlin or Merlin's dependencies can cause issues. + +To run the [movielens example](https://github.com/NVIDIA-Merlin/NVTabular/tree/stable/examples/getting-started-movielens) on AWS SageMaker, do the following: + +1. Login into your AWS console and select AWS SageMaker. + +2. Select `Notebook` -> `Notebook instances` -> `Create notebook instance`. Give the instance a name and select a notebook instance type with GPUs. For example, we selected `ml.p3.2xlarge`. Please review the associated costs with each instance type. As a platform identifier, select `notebook-al2-v1`. The previous platform identifier runs with TensorFlow 2.1.x and we had more issue to update it to TensorFlow 2.6.x. The `volume size` can be increased in the section `Additional configuration`. + +3. After the instance is running, connect to jupyter lab. + +4. Start a terminal to have access to the command line. + +5. The image contains many conda environments, which requires ~60GB of disk space. You can remove some of them to free disk space in the folder `/home/ec2-user/anaconda3/envs/` + +6. Clone the NVTabular repository and install the conda environment. + +``` +cd /home/ec2-user/SageMaker/ +git clone https://github.com/NVIDIA-Merlin/NVTabular.git +conda env create -f=NVTabular/conda/environments/nvtabular_aws_sagemaker.yml +``` + +7. Activate the conda environment + +``` +source /home/ec2-user/anaconda3/etc/profile.d/conda.sh +conda activate nvtabular +``` + +8. Install additional packages, such as TensorFlow or PyTorch + +``` +pip install tensorflow-gpu +pip install torch +pip install graphviz +``` + +9. Install Transformer4Rec, torchmetrics and ipykernel + +``` +conda install -y -c nvidia -c rapidsai -c numba -c conda-forge transformers4rec +conda install -y torchmetrics ipykernel +``` + +10. Add conda environment as ipykernel + +``` +python -m ipykernel install --user --name=nvtabular +``` + +11. You can switch in jupyter lab and run the [movielens example](https://github.com/NVIDIA-Merlin/NVTabular/tree/stable/examples/getting-started-movielens). + +This workflow enables NVTabular ETL and training with TensorFlow or Pytorch. Deployment with Triton Inference Server will follow soon. diff --git a/review/pr-1877/_sources/resources/index.rst b/review/pr-1877/_sources/resources/index.rst new file mode 100644 index 00000000000..861c4216227 --- /dev/null +++ b/review/pr-1877/_sources/resources/index.rst @@ -0,0 +1,12 @@ +Additional Resources +==================== + +.. toctree:: + :maxdepth: 2 + + Architecture + Cloud Integration + Troubleshooting + developer.nvidia.com page + Presentations and Blog Posts + Github Repo diff --git a/review/pr-1877/_sources/resources/links.md b/review/pr-1877/_sources/resources/links.md new file mode 100644 index 00000000000..f1689191a27 --- /dev/null +++ b/review/pr-1877/_sources/resources/links.md @@ -0,0 +1,28 @@ +# Talks and Blog Posts + +This is a collection of presentations, blog posts and documentation around NVIDIA Merlin (NVTabular and HugeCTR). + +## Talks + +- [Part 6: "AI for Every Company" | GTC Keynote Oct 2020](https://www.youtube.com/watch?v=XiwVziNh_3s) Oct 5th, 2020 +- [A Deep Dive into the NVIDIA Merlin Recommendation Framework | GTC Session Oct 2020](https://www.nvidia.com/en-us/on-demand/session/gtcfall20-a21132/) Oct 6th, 2020 +- [Merlin: A GPU Accelerated Recommendation Framework | KDD 2020 Aug 2020](https://www.youtube.com/watch?v=Pi2kCE5xcpw&feature=youtu.be) Aug 22nd, 2020 +- [NVTabular: GPU Accelerated ETL for Recommender Systems | GTC Session May 2020](https://www.nvidia.com/en-us/on-demand/session/gtcsj20-s21651/) May 15th, 2020 +- [HugeCTR: High-Performance Click-Through Rate Estimation Training | GTC Session May 2020](https://www.nvidia.com/en-us/on-demand/session/gtcsj20-s21455/) May 15th, 2020 + +## Blog posts + +We frequently post updates on [our blog](https://medium.com/nvidia-merlin) and on the [NVIDIA Developer Technical Blog](https://developer.nvidia.com/blog?r=1&tags=&categories=recommendation-systems). + +Some highlights: + +- [Why isn’t your recommender system training faster on GPU? (And what can you do about it?)](https://medium.com/nvidia-merlin/why-isnt-your-recommender-system-training-faster-on-gpu-and-what-can-you-do-about-it-6cb44a711ad4) Dec 3rd, 2020 +- [Democratizing Deep Learning Recommenders Resources](https://news.developer.nvidia.com/democratizing-deep-learning-recommenders-resources/?ncid=so-link-59588#cid=dl19_so-link_en-us) Dec 3rd, 2020 +- [NVIDIA Merlin Deepens Commitment to Deep Learning Recommenders with Latest Beta Update](https://news.developer.nvidia.com/nvidia-merlin-deepens-commitment-to-deep-learning-recommenders-with-latest-beta-update/), Nov 23rd, 2020 +- [NVIDIA Merlin Powers Fastest Commercially Available Solution for Recommender Systems Training](https://news.developer.nvidia.com/nvidia-merlin-powers-fastest-commercially-available-solution-for-recommender-systems-training/), Oct 6th, 2020 +- [Announcing the NVIDIA NVTabular Open Beta with Multi-GPU Support and New Data Loaders](https://developer.nvidia.com/blog/announcing-the-nvtabular-open-beta-with-multi-gpu-support-and-new-data-loaders/) Oct 5th, 2020 +- [Accelerating Recommender Systems Training with NVIDIA Merlin Open Beta](https://developer.nvidia.com/blog/accelerating-recommender-systems-training-with-nvidia-merlin-open-beta/) Oct 5th, 2020 +- [Better Predictions at Scale with Merlin](https://news.developer.nvidia.com/better-predictions-at-scale-with-merlin/) Aug 20th, 2020 +- [Developer Blog: Introducing NVIDIA Merlin HugeCTR](https://news.developer.nvidia.com/developer-blog-introducing-nvidia-merlin-hugectr/) July 28th, 2020 +- [Scalable Recommender Systems with NVTabular- A Fast Tabular Data Loading and Transformation Library](https://medium.com/rapids-ai/gpu-recommender-systems-with-nvtabular-eee056c37ea0) Jul 23rd, 2020 +- [Introducing NVIDIA Merlin HugeCTR: A Training Framework Dedicated to Recommender Systems](https://developer.nvidia.com/blog/introducing-merlin-hugectr-training-framework-dedicated-to-recommender-systems/) July 21st, 2020 diff --git a/review/pr-1877/_sources/resources/troubleshooting.md b/review/pr-1877/_sources/resources/troubleshooting.md new file mode 100644 index 00000000000..6b4416bc529 --- /dev/null +++ b/review/pr-1877/_sources/resources/troubleshooting.md @@ -0,0 +1,169 @@ +# Troubleshooting + +## Checking the Schema of the Parquet File + +NVTabular expects that all input parquet files have the same schema, which includes column types and the nullable (not null) option. If you encounter the error + +``` +RuntimeError: Schemas are inconsistent, try using to_parquet(..., schema="infer"), +or pass an explicit pyarrow schema. Such as to_parquet(..., schema={"column1": pa.string()}) +``` + +when you load the dataset as shown below, one of your parquet files might have a different schema: + +```python +ds = nvt.Dataset(PATH, engine="parquet", part_size="1000MB") +ds.to_ddf().head() +``` + +The easiest way to fix this is to load your dataset with dask_cudf and save it again using the parquet format ( `dask_cudf.read_parquet("INPUT_FOLDER").to_parquet("OUTPUT_FOLDER")`), so that the parquet file is standardized and the `_metadata` file is generated. + +If you want to identify which parquet files contain columns with different schemas, you can run one of these scripts: + +- [PyArrow](https://github.com/dask/dask/issues/6504#issuecomment-675465645) +- [cudf=0.17](https://github.com/rapidsai/cudf/pull/6796#issue-522934284) + +These scripts check for schema consistency and generate only the `_metadata` file instead of +converting all the parquet files. If the schema is inconsistent across all files, the script will +raise an exception. For additional information, see [this +issue](https://github.com/NVIDIA/NVTabular/issues/429). + +## Reducing Memory Consumption for NVTabular Workflows + +NVTabular is designed to scale to larger than GPU or host memory datasets. In our experiments, we are able to [scale to 1.3TB of uncompressed click logs](https://github.com/NVIDIA/NVTabular/tree/stable/examples/scaling-criteo). However, some workflows can result in OOM errors `cudaErrorMemoryAllocation out of memory`, which can be addressed by small configuration changes. + +### Setting the Row Group Size for the Parquet Files + +You can use most Data Frame frameworks to set the row group size (number of rows) for your parquet files. In the following Pandas and cuDF examples, the `row_group_size` is the number of rows that will be stored in each row group (internal structure within the parquet file): + +```python +#Pandas +pandas_df.to_parquet("/file/path", engine="pyarrow", row_group_size=10000) +#cuDF +cudf_df.to_parquet("/file/path", engine="pyarrow", row_group_size=10000) +``` + +The row group **memory** size of the parquet files should be smaller than the **part_size** that +you set for the NVTabular dataset such as `nvt.Dataset(TRAIN_DIR, engine="parquet", part_size="1000MB")`. To determine how much memory a row group will hold, you can slice your dataframe to a specific number of rows and use the following function to get the memory usage in bytes. You can then set the row_group_size (number of rows) accordingly when you save the parquet file. A row group memory size that is close to 128MB is recommended. + +```python +def _memory_usage(df): + """this function is a workaround for obtaining memory usage lists + in cudf0.16. This can be deleted and replaced with `df.memory_usage(deep= True, index=True).sum()` + when using cudf 0.17, which has been fixed as noted on https://github.com/rapidsai/cudf/pull/6549)""" + size = 0 + for col in df._data.columns: + if cudf.api.types.is_list_dtype(col.dtype): + for child in col.base_children: + size += child.__sizeof__() + else: + size += col._memory_usage(deep=True) + size += df.index.memory_usage(deep=True) + return size +``` + +### Initializing a Dask CUDA Cluster + +Even if you only have a single GPU to work with, it is best practice to use a distributed Dask-CUDA cluster to execute memory-intensive NVTabular workflows. If there is no distributed `client` object passed to an NVTabular `Workflow`, it will fall back on Dask’s single-threaded “synchronous” scheduler at computation time. The primary advantage of using a Dask-CUDA cluster is that the Dask-CUDA workers enable GPU-aware memory spilling. In our experience, many OOM errors can be resolved by initializing a dask-CUDA cluster with an appropriate `device_memory_limit` setting, and by passing a corresponding client to NVTabular. It is easy to deploy a single-machine dask-CUDA cluster using `LocalCUDACluster`. + +```python +from dask_cuda import LocalCUDACluster +from dask.distributed import Client + +import nvtabular as nvt + +cluster = LocalCUDACluster( + n_workers=1, # Number of GPU workers + device_memory_limit="24GB", # GPU->CPU spill threshold (~75% of GPU memory) + rmm_pool_size="28GB", # Memory pool size on each worker + local_directory="/nvme/scratch/", # Fast directory for disk spilling +) +client = Client(cluster) + +features = ['col'] >> nvt.ops.Normalize() + +workflow = nvt.Workflow(features, client=client) + +client.shutdown() +client.close() +``` + +### String Column Error + +If you run into a problem an error that states the size of your string column is too large, like: + +``` +Exception: RuntimeError('cuDF failure at: /opt/conda/envs/rapids/conda-bld/libcudf_1618503955512/work/cpp/src/copying/concatenate.cu:368: Total number of concatenated rows exceeds size_type range') +``` + +This is usually caused by string columns in parquet files. If you encounter this error, to fix it you need to decrease the size of the partitions of your dataset. If, after decreasing the size of the partitions, you get a warning about picking a partition size smaller than the row group size, you will need to reformat the dataset with a smaller row group size (refer to #1). There is a 2GB max size for concatenated string columns in cudf currently, for details refer to [this](https://github.com/rapidsai/cudf/issues/3958). + +### Special Considerations for TensorFlow 2.7 and Lower + +The example notebooks in the repository are developed and tested with the latest [Merlin containers](https://catalog.ngc.nvidia.com/containers?filters=&orderBy=dateModifiedDESC&query=merlin) that are available from the NGC Catalog. +If you run the example notebooks in an environment that has a different version of TensorFlow, you might experience an out-of-memory condition that requires you to perform additional configuration. +The version of TensorFlow in each Merlin container is available from the [support matrix](https://nvidia-merlin.github.io/Merlin/stable/support_matrix/index.html) in the Merlin documentation. + +TensorFlow 2.8 uses `cuda_malloc_async` as the default GPU memory allocation function. +TensorFlow specifies the function in the `TF_GPU_ALLOCATOR` environment variable. + +In the 2.7 release, the setting was available as an experimental feature and was not activated by default. +In releases 2.6 and lower, the setting is not available at all. + +If the `cuda_malloc_async` function is not available or not specified, TensorFlow reserves all GPU memory. +In these cases, you can limit the amount of memory used by TensorFlow with the `TF_MEMORY_ALLOCATION` environment variable. + +If you experience an out-of-memory issue with an older TensorFlow version, try specifying the `cuda_malloc_async` function as the GPU memory allocation function or set the `TF_MEMORY_ALLOCATION` environment variable. + +For example, for TensorFlow 2.7, use code like the following example: + +```python +import os +os.environ["TF_GPU_ALLOCATOR"] = "cuda_malloc_async" +``` + +For TensorFlow 2.6 and lower, use code like the following example: + +```python +import os +os.environ["TF_MEMORY_ALLOCATION"] = "0.5" +``` + +Specify a value between `0` and `1`. +The value indicates the percentage of GPU memory to allocate to TensorFlow. + +## Reducing Memory Consumption for NVTabular Dataloaders + +NVTabular dataloaders are designed to read data from disk directly into the GPU and prepare the batch. We see this process as really efficient, as the NVTabular dataloaders avoid any CPU-GPU communication and the data will be only processed by the GPU. On the other hand, the dataloader will require GPU memory to hold the data. In some cases, this can cause OOM errors to use NVTabular dataloader on the GPU and train a neural network on the GPU. We can adjust the GPU consumption of the NVTabular dataloader with following configurations. + +### 1. Row Group Size for the Parquet Files + +It is important that the input parquet files are correctly configured. If you use NVTabular ETL to transform your data, then NVTabular will use the best configuration by default. If you do not use NVTabular ETL, you can take a look on the section above `Reducing Memory Consumption for NVTabular Workflows`. + +### 2. Setting `part_size` in nvt.Dataset + +The class nvt.Dataset abstracts the dataset to a common object. It will read the data from disk into chunks. The parameter `part_size` defines the desired size of each dask partition. You can reduce the GPU memory consumption of the NVTabular dataloader by changing the parameter. This can effect the speed how fast NVTabular dataloader can read the data, but it should not be significant in comparison to updating the neural network parameters. You can try out different values, such as `100MB`, `300MB` or `1000MB`. + +PyTorch: + +```python +train_loader = TorchAsyncItr( + nvt.Dataset(train_files, part_size="300MB"), + batch_size=1024*64, + cats=CATEGORICAL_COLUMNS, + conts=CONTINUOUS_COLUMNS, + labels=LABEL_COLUMNS +) +``` + +TensorFlow: + +```python +train_loader = KerasSequenceLoader( + nvt.Dataset(train_files, part_size="300MB"), + batch_size=BATCH_SIZE, + label_names=LABEL_COLUMNS, + cat_names=CATEGORICAL_COLUMNS, + cont_names=CONTINUOUS_COLUMNS +) +``` diff --git a/review/pr-1877/_sources/training/hugectr.rst b/review/pr-1877/_sources/training/hugectr.rst new file mode 100644 index 00000000000..9c83cbbbc1d --- /dev/null +++ b/review/pr-1877/_sources/training/hugectr.rst @@ -0,0 +1,130 @@ +Accelerated Training with HugeCTR +================================= + +A real-world production model serves hundreds of millions of users, +which contains embedding tables with up to 100GB to 1TB in size. Training deep +learning recommender system models with such large embedding tables can be challenging +as they do not fit into the memory of a single GPU. + +To combat that challenge, we developed HugeCTR, which is an open-source deep learning framework that is a highly optimized library +written in CUDA C++, specifically for recommender systems. It supports +an optimized dataloader and is able to scale embedding tables using +multiple GPUs and nodes. As a result, there is no embedding table size +limitation. HugeCTR also offers the following: + +- Model oversubscription for training embedding tables with + single nodes that don't fit within the GPU or CPU memory (only + required embeddings are prefetched from a parameter server per + batch). +- Asynchronous and multithreaded data pipelines. +- A highly optimized data loader. +- Implementation of common architectures such as Wide&Deep and DLRM. +- Support for data formats such as parquet and binary. +- Easy configuration using JSON or the Python API. + +When training is accelerated with HugeCTR, the following happens: + +1. The required libraries are imported in which the HugeCTR lib + directory is specified as follows: + + .. code:: python + + import sys + sys.path.append("/usr/local/hugectr/lib") + from hugectr import Session, solver_parser_helper, get_learning_rate_scheduler + +2. The JSON configuration file is specified, which defines the model + architecture. + + .. code:: python + + # Set config file + json_file = "dlrm_fp32_64k.json" + + The JSON file defines the input layers as follows: + + - ``slot_size_array`` is the cardinality of categorical input + features + - ``source`` is a text file that contains filenames for training + - ``eval_source`` is a text file that contains filenames for + evaluation + - ``label``-``label_dim`` provides the number of target columns + - ``dense``-``label_dim`` provides the number of continuous input + features + - ``sparse``-``label_dim`` provides the number of categorical input + features + + .. code:: python + + # Part of JSON config + "layers": [ + { + "name": "data", + "type": "Data", + "format": "Parquet", + "slot_size_array": [10000000, 10000000, 3014529, 400781, 11, 2209, 11869, 148, 4, 977, 15, 38713, 10000000, 10000000, 10000000, 584616, 12883, 109, 37, 17177, 7425, 20266, 4, 7085, 1535, 64], + "source": "/raid/criteo/tests/test_dask/output/train/_file_list.txt", + "eval_source": "/raid/criteo/tests/test_dask/output/valid/_file_list.txt", + "check": "None", + "label": { + "top": "label", + "label_dim": 1 + }, + "dense": { + "top": "dense", + "dense_dim": 13 + }, + "sparse": [ + { + "top": "data1", + "type": "LocalizedSlot", + "max_feature_num_per_sample": 30, + "max_nnz": 1, + "slot_num": 26 + } + ] + }, + +3. The solver configuration is defined. The batch_sizes for training, + validation, and GPUs are specified in the solver + configuration. + + .. code:: python + + # Set solver config + solver_config = solver_parser_helper(seed = 0, + batchsize = 16384, + batchsize_eval = 16384, + vvgpu = [[0,1,2,3,4,5,6,7]], + repeat_dataset = True + + ) + +4. The learning rate schedule in the JSON file and HugeCTR session is + initialized. + + .. code:: python + + # Set learning rate + lr_sch = get_learning_rate_scheduler(json_file) + # Train model + sess = Session(solver_config, json_file) + sess.start_data_reading() + +5. The dataset is iterated for 5000 steps and the model is trained. + + .. code:: python + + for i in range(5000): + lr = lr_sch.get_next() + sess.set_learning_rate(lr) + sess.train() + if (i%100 == 0): + loss = sess.get_current_loss() + print("[HUGECTR][INFO] iter: {}; loss: {}".format(i, loss)) + if (i%3000 == 0 and i != 0): + metrics = sess.evaluation() + print("[HUGECTR][INFO] iter: {}, {}".format(i, metrics)) + +For more information, refer to the `HugeCTR documentation `_ +or the `HugeCTR repository `_ on GitHub. diff --git a/review/pr-1877/_sources/training/index.rst b/review/pr-1877/_sources/training/index.rst new file mode 100644 index 00000000000..9905037baa5 --- /dev/null +++ b/review/pr-1877/_sources/training/index.rst @@ -0,0 +1,18 @@ +Accelerated Training +==================== + +NVIDIA Merlin accelerates the recommendation pipeline from end to end. Applying deep learning models to the recommendation pipeline has unique challenges in comparison to other domains, such as computer vision and natural language processing. With the constant additions of new items and users along with their evolving content desires, the deep learning model needs to be updated regularly. To achieve this, NVIDIA Merlin offers three accelerated dataloaders. + +Recommendation system datasets can be terabytes in size with billions of examples but each example is represented by only a few bytes. For example, the Criteo CTR dataset, which is the largest publicly available dataset, has 1.3TB with 4 billion samples. The model architectures typically have large embedding tables with hundreds of millions of users and items that do not fit on a single GPU. + +The base dataloader in PyTorch and TensorFlow randomly sample each item from the dataset, which is very slow. The window dataloader in TensorFlow isn’t any faster. In our experiments, we were able to speed up existing TensorFlow pipelines by 9 times with our highly optimized dataloaders. HugeCTR, our dedicated deep learning framework for recommender systems can achieve speedups up to 13 times. In addition, HugeCTR supports model parallel scaling for embedding tables that require a lot of memory. HugeCTR can distribute an embedding table over multiple GPUs or multiple nodes. + +For additional information, see our latest `blog post +`_. + +.. toctree:: + :maxdepth: 2 + + TensorFlow + PyTorch + HugeCTR diff --git a/review/pr-1877/_sources/training/pytorch.rst b/review/pr-1877/_sources/training/pytorch.rst new file mode 100644 index 00000000000..f6023e5d1e7 --- /dev/null +++ b/review/pr-1877/_sources/training/pytorch.rst @@ -0,0 +1,84 @@ +Accelerated Training with PyTorch +================================= + +When training pipelines with PyTorch, the dataloader cannot prepare +sequential batches fast enough, so the GPU is not fully utilized. To +combat this issue, we’ve developed a highly customized tabular +dataloader, ``TorchAsyncItr``, to accelerate existing pipelines in +PyTorch. The NVTabular dataloader is capable of: + +- removing bottlenecks from dataloading by processing large chunks of + data at a time instead of item by item +- processing datasets that don't fit within the GPU or CPU memory by + streaming from the disk +- reading data directly into the GPU memory and removing CPU-GPU + communication +- preparing batch asynchronously into the GPU to avoid CPU-GPU + communication +- supporting commonly used formats such as parquet +- integrating easily into existing PyTorch training pipelines by using + a similar API as the native PyTorch dataloader + +When ``TorchAsyncItr`` accelerates training with PyTorch, the following +happens: + +1. The required libraries are imported. + + .. code:: python + + import torch + from nvtabular.loader.torch import TorchAsyncItr, DLDataLoader + +2. The ``TorchAsyncItr`` iterator is initialized. The input is a + NVTabular dataset that uses a list of file names. The NVTabular + dataset is an abstraction layer that iterates over the full dataset + in chunks. The dataset schema is defined in which ``cats`` are the + column names for the categorical input features, ``conts`` are the + column names for the continuous input features, and ``labels`` are + the column names for the target. Each parameter should be formatted + as a list of strings. The batch size is also specified. + + .. code:: python + + TRAIN_PATHS = glob.glob("./train/*.parquet") + train_dataset = TorchAsyncItr( + nvt.Dataset(TRAIN_PATHS), + cats=CATEGORICAL_COLUMNS, + conts=CONTINUOUS_COLUMNS, + labels=LABEL_COLUMNS, + batch_size=BATCH_SIZE + ) + +3. ``TorchAsyncItr`` is wrapped as ``DLDataLoader``. + + .. code:: python + + train_loader = DLDataLoader( + train_dataset, + batch_size=None, + collate_fn=collate_fn, + pin_memory=False, + num_workers=0 + ) + +4. If a ``torch.nn.Module`` model was created, ``train_loader`` can be + used in the same way as the PyTorch dataloader. + + .. code:: python + + ... + model = get_model() + optimizer = torch.optim.Adam(model.parameters(), lr=0.01) + for x_cat, x_cont, y in iter(dataloader): + y_pred = model(x_cat, x_cont) + loss = loss_func(y_pred, y) + optimizer.zero_grad() + loss.backward() + optimizer.step() + +5. The ``TorchAsyncItr`` dataloader can be initialized for the + validation dataset using the same structure. + +You can find additional `examples`_ in our repository. + +.. _examples: ../examples/ diff --git a/review/pr-1877/_sources/training/tensorflow.rst b/review/pr-1877/_sources/training/tensorflow.rst new file mode 100644 index 00000000000..4faa982ad17 --- /dev/null +++ b/review/pr-1877/_sources/training/tensorflow.rst @@ -0,0 +1,117 @@ +Accelerated Training with TensorFlow +==================================== + +When training pipelines with TensorFlow, the dataloader cannot prepare +sequential batches fast enough, so the GPU is not fully utilized. To +combat this issue, we’ve developed a highly customized tabular +dataloader, ``KerasSequenceLoader``, to accelerate existing pipelines in +TensorFlow. In our experiments, we were able to achieve a speed-up 9 +times as fast as the same training workflow that contains a NVTabular +dataloader. The NVTabular dataloader is capable of: + +- removing bottlenecks from dataloading by processing large chunks of + data at a time instead of item by item +- processing datasets that don’t fit within the GPU or CPU memory by + streaming from the disk +- reading data directly into the GPU memory and removing CPU-GPU + communication +- preparing batch asynchronously into the GPU to avoid CPU-GPU + communication +- supporting commonly used formats such as parquet +- integrating easily into existing TensorFlow training pipelines by + using a similar API as the native TensorFlow dataloader since it + works with tf.keras models + +When ``KerasSequenceLoader`` accelerates training with TensorFlow, the +following happens: + +1. The required libraries are imported. The dataloader loads and + prepares batches directly in the GPU and requires some of the GPU + memory. Before initializing TensorFlow, the amount of memory that is + allocated to TensorFlow needs to be controlled as well as the + remaining memory allocation that is allocated to the dataloader. The + environment variable 'TF\_MEMORY\_ALLOCATION' can be used to control + the TensorFlow memory allocation. + + .. code:: python + + import tensorflow as tf + + # Control how much memory to give TensorFlow with this environment variable + # IMPORTANT: Do this before you initialize the TensorFlow runtime, otherwise + # it's too late and TensorFlow will claim all free GPU memory + os.environ['TF_MEMORY_ALLOCATION'] = "8192" # explicit MB + os.environ['TF_MEMORY_ALLOCATION'] = "0.5" # fraction of free memory + from nvtabular.loader.tensorflow import KerasSequenceLoader, + KerasSequenceValidater + +2. The data schema is defined with ``tf.feature_columns``, the + categorical input features (``CATEGORICAL_COLUMNS``) are fed through + an embedding layer, and the continuous input (``CONTINUOUS_COLUMNS``) + features are defined with ``numeric_column``. The + ``EMBEDDING_TABLE_SHAPES`` is a dictionary that contains cardinality + and emb\_size tuples for each categorical feature. + + .. code:: python + + def make_categorical_embedding_column(name, dictionary_size, embedding_dim): + return tf.feature_column.embedding_column( + tf.feature_column.categorical_column_with_identity(name, dictionary_size), + embedding_dim + ) + + # instantiate the columns + categorical_columns = [ + make_categorical_embedding_column(name,*EMBEDDING_TABLE_SHAPES[name]) for name in CATEGORICAL_COLUMNS + ] + continuous_columns = [ + tf.feature_column.numeric_column(name, (1,)) for name in CONTINUOUS_COLUMNS + ] + +3. The NVTabular dataloader is initialized. The NVTabular dataloader + supports a list of filenames and glob pattern as input, which it will + load and iterate over. ``feature_columns`` defines the data + structure, which uses the ``tf.feature_column`` structure that was + previously defined. The\ ``batch_size``, ``label_names`` (target + columns), ``shuffle``, and ``buffer_size`` are defined. + + .. code:: python + + TRAIN_PATHS = glob.glob("./train/*.parquet") + train_dataset_tf = KerasSequenceLoader( + TRAIN_PATHS, # you could also use a glob pattern + feature_columns=categorical_columns + continuous_columns, + batch_size=BATCH_SIZE, + label_names=LABEL_COLUMNS, + shuffle=True, + buffer_size=0.06 # amount of data, as a fraction of GPU memory, to load at one time + ) + +4. The TensorFlow Keras model ( ``tf.keras.Model``) is defined if a + neural network architecture is created in which ``inputs`` are the + input tensors and ``output`` is the output tensors. + + .. code:: python + + model = tf.keras.Model(inputs=inputs, outputs=output) + model.compile('sgd', 'binary_crossentropy') + +5. The model is trained with ``model.fit`` using the NVTabular + dataloader. + + .. code:: python + + history = model.fit(train_dataset_tf, epochs=5) + +**Note**: If using the NVTabular dataloader for the validation dataset, +a callback can be used for it. + + .. code:: python + + valid_dataset_tf = KerasSequenceLoader(...) + validation_callback = KerasSequenceValidater(valid_dataset_tf) + history = model.fit(train_dataset_tf, callbacks=[validation_callback], epochs=5) + +You can find additional `examples`_ in our repository. + +.. _examples: ../examples/ diff --git a/review/pr-1877/_sphinx_design_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css b/review/pr-1877/_sphinx_design_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css new file mode 100644 index 00000000000..eb19f698afc --- /dev/null +++ b/review/pr-1877/_sphinx_design_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css @@ -0,0 +1 @@ +.sd-bg-primary{background-color:var(--sd-color-primary) !important}.sd-bg-text-primary{color:var(--sd-color-primary-text) !important}button.sd-bg-primary:focus,button.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}a.sd-bg-primary:focus,a.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}.sd-bg-secondary{background-color:var(--sd-color-secondary) !important}.sd-bg-text-secondary{color:var(--sd-color-secondary-text) !important}button.sd-bg-secondary:focus,button.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}a.sd-bg-secondary:focus,a.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}.sd-bg-success{background-color:var(--sd-color-success) !important}.sd-bg-text-success{color:var(--sd-color-success-text) !important}button.sd-bg-success:focus,button.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}a.sd-bg-success:focus,a.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}.sd-bg-info{background-color:var(--sd-color-info) !important}.sd-bg-text-info{color:var(--sd-color-info-text) !important}button.sd-bg-info:focus,button.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}a.sd-bg-info:focus,a.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}.sd-bg-warning{background-color:var(--sd-color-warning) !important}.sd-bg-text-warning{color:var(--sd-color-warning-text) !important}button.sd-bg-warning:focus,button.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}a.sd-bg-warning:focus,a.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}.sd-bg-danger{background-color:var(--sd-color-danger) !important}.sd-bg-text-danger{color:var(--sd-color-danger-text) !important}button.sd-bg-danger:focus,button.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}a.sd-bg-danger:focus,a.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}.sd-bg-light{background-color:var(--sd-color-light) !important}.sd-bg-text-light{color:var(--sd-color-light-text) !important}button.sd-bg-light:focus,button.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}a.sd-bg-light:focus,a.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}.sd-bg-muted{background-color:var(--sd-color-muted) !important}.sd-bg-text-muted{color:var(--sd-color-muted-text) !important}button.sd-bg-muted:focus,button.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}a.sd-bg-muted:focus,a.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}.sd-bg-dark{background-color:var(--sd-color-dark) !important}.sd-bg-text-dark{color:var(--sd-color-dark-text) !important}button.sd-bg-dark:focus,button.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}a.sd-bg-dark:focus,a.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}.sd-bg-black{background-color:var(--sd-color-black) !important}.sd-bg-text-black{color:var(--sd-color-black-text) !important}button.sd-bg-black:focus,button.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}a.sd-bg-black:focus,a.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}.sd-bg-white{background-color:var(--sd-color-white) !important}.sd-bg-text-white{color:var(--sd-color-white-text) !important}button.sd-bg-white:focus,button.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}a.sd-bg-white:focus,a.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}.sd-text-primary,.sd-text-primary>p{color:var(--sd-color-primary) !important}a.sd-text-primary:focus,a.sd-text-primary:hover{color:var(--sd-color-primary-highlight) !important}.sd-text-secondary,.sd-text-secondary>p{color:var(--sd-color-secondary) !important}a.sd-text-secondary:focus,a.sd-text-secondary:hover{color:var(--sd-color-secondary-highlight) !important}.sd-text-success,.sd-text-success>p{color:var(--sd-color-success) !important}a.sd-text-success:focus,a.sd-text-success:hover{color:var(--sd-color-success-highlight) !important}.sd-text-info,.sd-text-info>p{color:var(--sd-color-info) !important}a.sd-text-info:focus,a.sd-text-info:hover{color:var(--sd-color-info-highlight) !important}.sd-text-warning,.sd-text-warning>p{color:var(--sd-color-warning) !important}a.sd-text-warning:focus,a.sd-text-warning:hover{color:var(--sd-color-warning-highlight) !important}.sd-text-danger,.sd-text-danger>p{color:var(--sd-color-danger) !important}a.sd-text-danger:focus,a.sd-text-danger:hover{color:var(--sd-color-danger-highlight) !important}.sd-text-light,.sd-text-light>p{color:var(--sd-color-light) !important}a.sd-text-light:focus,a.sd-text-light:hover{color:var(--sd-color-light-highlight) !important}.sd-text-muted,.sd-text-muted>p{color:var(--sd-color-muted) !important}a.sd-text-muted:focus,a.sd-text-muted:hover{color:var(--sd-color-muted-highlight) !important}.sd-text-dark,.sd-text-dark>p{color:var(--sd-color-dark) !important}a.sd-text-dark:focus,a.sd-text-dark:hover{color:var(--sd-color-dark-highlight) !important}.sd-text-black,.sd-text-black>p{color:var(--sd-color-black) !important}a.sd-text-black:focus,a.sd-text-black:hover{color:var(--sd-color-black-highlight) !important}.sd-text-white,.sd-text-white>p{color:var(--sd-color-white) !important}a.sd-text-white:focus,a.sd-text-white:hover{color:var(--sd-color-white-highlight) !important}.sd-outline-primary{border-color:var(--sd-color-primary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-primary:focus,a.sd-outline-primary:hover{border-color:var(--sd-color-primary-highlight) !important}.sd-outline-secondary{border-color:var(--sd-color-secondary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-secondary:focus,a.sd-outline-secondary:hover{border-color:var(--sd-color-secondary-highlight) !important}.sd-outline-success{border-color:var(--sd-color-success) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-success:focus,a.sd-outline-success:hover{border-color:var(--sd-color-success-highlight) !important}.sd-outline-info{border-color:var(--sd-color-info) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-info:focus,a.sd-outline-info:hover{border-color:var(--sd-color-info-highlight) !important}.sd-outline-warning{border-color:var(--sd-color-warning) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-warning:focus,a.sd-outline-warning:hover{border-color:var(--sd-color-warning-highlight) !important}.sd-outline-danger{border-color:var(--sd-color-danger) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-danger:focus,a.sd-outline-danger:hover{border-color:var(--sd-color-danger-highlight) !important}.sd-outline-light{border-color:var(--sd-color-light) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-light:focus,a.sd-outline-light:hover{border-color:var(--sd-color-light-highlight) !important}.sd-outline-muted{border-color:var(--sd-color-muted) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-muted:focus,a.sd-outline-muted:hover{border-color:var(--sd-color-muted-highlight) !important}.sd-outline-dark{border-color:var(--sd-color-dark) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-dark:focus,a.sd-outline-dark:hover{border-color:var(--sd-color-dark-highlight) !important}.sd-outline-black{border-color:var(--sd-color-black) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-black:focus,a.sd-outline-black:hover{border-color:var(--sd-color-black-highlight) !important}.sd-outline-white{border-color:var(--sd-color-white) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-white:focus,a.sd-outline-white:hover{border-color:var(--sd-color-white-highlight) !important}.sd-bg-transparent{background-color:transparent !important}.sd-outline-transparent{border-color:transparent !important}.sd-text-transparent{color:transparent !important}.sd-p-0{padding:0 !important}.sd-pt-0,.sd-py-0{padding-top:0 !important}.sd-pr-0,.sd-px-0{padding-right:0 !important}.sd-pb-0,.sd-py-0{padding-bottom:0 !important}.sd-pl-0,.sd-px-0{padding-left:0 !important}.sd-p-1{padding:.25rem !important}.sd-pt-1,.sd-py-1{padding-top:.25rem !important}.sd-pr-1,.sd-px-1{padding-right:.25rem !important}.sd-pb-1,.sd-py-1{padding-bottom:.25rem !important}.sd-pl-1,.sd-px-1{padding-left:.25rem !important}.sd-p-2{padding:.5rem !important}.sd-pt-2,.sd-py-2{padding-top:.5rem !important}.sd-pr-2,.sd-px-2{padding-right:.5rem !important}.sd-pb-2,.sd-py-2{padding-bottom:.5rem !important}.sd-pl-2,.sd-px-2{padding-left:.5rem !important}.sd-p-3{padding:1rem !important}.sd-pt-3,.sd-py-3{padding-top:1rem !important}.sd-pr-3,.sd-px-3{padding-right:1rem !important}.sd-pb-3,.sd-py-3{padding-bottom:1rem !important}.sd-pl-3,.sd-px-3{padding-left:1rem !important}.sd-p-4{padding:1.5rem !important}.sd-pt-4,.sd-py-4{padding-top:1.5rem !important}.sd-pr-4,.sd-px-4{padding-right:1.5rem !important}.sd-pb-4,.sd-py-4{padding-bottom:1.5rem !important}.sd-pl-4,.sd-px-4{padding-left:1.5rem !important}.sd-p-5{padding:3rem !important}.sd-pt-5,.sd-py-5{padding-top:3rem !important}.sd-pr-5,.sd-px-5{padding-right:3rem !important}.sd-pb-5,.sd-py-5{padding-bottom:3rem !important}.sd-pl-5,.sd-px-5{padding-left:3rem !important}.sd-m-auto{margin:auto !important}.sd-mt-auto,.sd-my-auto{margin-top:auto !important}.sd-mr-auto,.sd-mx-auto{margin-right:auto !important}.sd-mb-auto,.sd-my-auto{margin-bottom:auto !important}.sd-ml-auto,.sd-mx-auto{margin-left:auto !important}.sd-m-0{margin:0 !important}.sd-mt-0,.sd-my-0{margin-top:0 !important}.sd-mr-0,.sd-mx-0{margin-right:0 !important}.sd-mb-0,.sd-my-0{margin-bottom:0 !important}.sd-ml-0,.sd-mx-0{margin-left:0 !important}.sd-m-1{margin:.25rem !important}.sd-mt-1,.sd-my-1{margin-top:.25rem !important}.sd-mr-1,.sd-mx-1{margin-right:.25rem !important}.sd-mb-1,.sd-my-1{margin-bottom:.25rem !important}.sd-ml-1,.sd-mx-1{margin-left:.25rem !important}.sd-m-2{margin:.5rem !important}.sd-mt-2,.sd-my-2{margin-top:.5rem !important}.sd-mr-2,.sd-mx-2{margin-right:.5rem !important}.sd-mb-2,.sd-my-2{margin-bottom:.5rem !important}.sd-ml-2,.sd-mx-2{margin-left:.5rem !important}.sd-m-3{margin:1rem !important}.sd-mt-3,.sd-my-3{margin-top:1rem !important}.sd-mr-3,.sd-mx-3{margin-right:1rem !important}.sd-mb-3,.sd-my-3{margin-bottom:1rem !important}.sd-ml-3,.sd-mx-3{margin-left:1rem !important}.sd-m-4{margin:1.5rem !important}.sd-mt-4,.sd-my-4{margin-top:1.5rem !important}.sd-mr-4,.sd-mx-4{margin-right:1.5rem !important}.sd-mb-4,.sd-my-4{margin-bottom:1.5rem !important}.sd-ml-4,.sd-mx-4{margin-left:1.5rem !important}.sd-m-5{margin:3rem !important}.sd-mt-5,.sd-my-5{margin-top:3rem !important}.sd-mr-5,.sd-mx-5{margin-right:3rem !important}.sd-mb-5,.sd-my-5{margin-bottom:3rem !important}.sd-ml-5,.sd-mx-5{margin-left:3rem !important}.sd-w-25{width:25% !important}.sd-w-50{width:50% !important}.sd-w-75{width:75% !important}.sd-w-100{width:100% !important}.sd-w-auto{width:auto !important}.sd-h-25{height:25% !important}.sd-h-50{height:50% !important}.sd-h-75{height:75% !important}.sd-h-100{height:100% !important}.sd-h-auto{height:auto !important}.sd-d-none{display:none !important}.sd-d-inline{display:inline !important}.sd-d-inline-block{display:inline-block !important}.sd-d-block{display:block !important}.sd-d-grid{display:grid !important}.sd-d-flex-row{display:-ms-flexbox !important;display:flex !important;flex-direction:row !important}.sd-d-flex-column{display:-ms-flexbox !important;display:flex !important;flex-direction:column !important}.sd-d-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}@media(min-width: 576px){.sd-d-sm-none{display:none !important}.sd-d-sm-inline{display:inline !important}.sd-d-sm-inline-block{display:inline-block !important}.sd-d-sm-block{display:block !important}.sd-d-sm-grid{display:grid !important}.sd-d-sm-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-sm-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 768px){.sd-d-md-none{display:none !important}.sd-d-md-inline{display:inline !important}.sd-d-md-inline-block{display:inline-block !important}.sd-d-md-block{display:block !important}.sd-d-md-grid{display:grid !important}.sd-d-md-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-md-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 992px){.sd-d-lg-none{display:none !important}.sd-d-lg-inline{display:inline !important}.sd-d-lg-inline-block{display:inline-block !important}.sd-d-lg-block{display:block !important}.sd-d-lg-grid{display:grid !important}.sd-d-lg-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-lg-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 1200px){.sd-d-xl-none{display:none !important}.sd-d-xl-inline{display:inline !important}.sd-d-xl-inline-block{display:inline-block !important}.sd-d-xl-block{display:block !important}.sd-d-xl-grid{display:grid !important}.sd-d-xl-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-xl-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}.sd-align-major-start{justify-content:flex-start !important}.sd-align-major-end{justify-content:flex-end !important}.sd-align-major-center{justify-content:center !important}.sd-align-major-justify{justify-content:space-between !important}.sd-align-major-spaced{justify-content:space-evenly !important}.sd-align-minor-start{align-items:flex-start !important}.sd-align-minor-end{align-items:flex-end !important}.sd-align-minor-center{align-items:center !important}.sd-align-minor-stretch{align-items:stretch !important}.sd-text-justify{text-align:justify !important}.sd-text-left{text-align:left !important}.sd-text-right{text-align:right !important}.sd-text-center{text-align:center !important}.sd-font-weight-light{font-weight:300 !important}.sd-font-weight-lighter{font-weight:lighter !important}.sd-font-weight-normal{font-weight:400 !important}.sd-font-weight-bold{font-weight:700 !important}.sd-font-weight-bolder{font-weight:bolder !important}.sd-font-italic{font-style:italic !important}.sd-text-decoration-none{text-decoration:none !important}.sd-text-lowercase{text-transform:lowercase !important}.sd-text-uppercase{text-transform:uppercase !important}.sd-text-capitalize{text-transform:capitalize !important}.sd-text-wrap{white-space:normal !important}.sd-text-nowrap{white-space:nowrap !important}.sd-text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-fs-1,.sd-fs-1>p{font-size:calc(1.375rem + 1.5vw) !important;line-height:unset !important}.sd-fs-2,.sd-fs-2>p{font-size:calc(1.325rem + 0.9vw) !important;line-height:unset !important}.sd-fs-3,.sd-fs-3>p{font-size:calc(1.3rem + 0.6vw) !important;line-height:unset !important}.sd-fs-4,.sd-fs-4>p{font-size:calc(1.275rem + 0.3vw) !important;line-height:unset !important}.sd-fs-5,.sd-fs-5>p{font-size:1.25rem !important;line-height:unset !important}.sd-fs-6,.sd-fs-6>p{font-size:1rem !important;line-height:unset !important}.sd-border-0{border:0 solid !important}.sd-border-top-0{border-top:0 solid !important}.sd-border-bottom-0{border-bottom:0 solid !important}.sd-border-right-0{border-right:0 solid !important}.sd-border-left-0{border-left:0 solid !important}.sd-border-1{border:1px solid !important}.sd-border-top-1{border-top:1px solid !important}.sd-border-bottom-1{border-bottom:1px solid !important}.sd-border-right-1{border-right:1px solid !important}.sd-border-left-1{border-left:1px solid !important}.sd-border-2{border:2px solid !important}.sd-border-top-2{border-top:2px solid !important}.sd-border-bottom-2{border-bottom:2px solid !important}.sd-border-right-2{border-right:2px solid !important}.sd-border-left-2{border-left:2px solid !important}.sd-border-3{border:3px solid !important}.sd-border-top-3{border-top:3px solid !important}.sd-border-bottom-3{border-bottom:3px solid !important}.sd-border-right-3{border-right:3px solid !important}.sd-border-left-3{border-left:3px solid !important}.sd-border-4{border:4px solid !important}.sd-border-top-4{border-top:4px solid !important}.sd-border-bottom-4{border-bottom:4px solid !important}.sd-border-right-4{border-right:4px solid !important}.sd-border-left-4{border-left:4px solid !important}.sd-border-5{border:5px solid !important}.sd-border-top-5{border-top:5px solid !important}.sd-border-bottom-5{border-bottom:5px solid !important}.sd-border-right-5{border-right:5px solid !important}.sd-border-left-5{border-left:5px solid !important}.sd-rounded-0{border-radius:0 !important}.sd-rounded-1{border-radius:.2rem !important}.sd-rounded-2{border-radius:.3rem !important}.sd-rounded-3{border-radius:.5rem !important}.sd-rounded-pill{border-radius:50rem !important}.sd-rounded-circle{border-radius:50% !important}.shadow-none{box-shadow:none !important}.sd-shadow-sm{box-shadow:0 .125rem .25rem var(--sd-color-shadow) !important}.sd-shadow-md{box-shadow:0 .5rem 1rem var(--sd-color-shadow) !important}.sd-shadow-lg{box-shadow:0 1rem 3rem var(--sd-color-shadow) !important}@keyframes sd-slide-from-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes sd-slide-from-right{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes sd-grow100{0%{transform:scale(0);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50{0%{transform:scale(0.5);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50-rot20{0%{transform:scale(0.5) rotateZ(-20deg);opacity:.5}75%{transform:scale(1) rotateZ(5deg);opacity:1}95%{transform:scale(1) rotateZ(-1deg);opacity:1}100%{transform:scale(1) rotateZ(0);opacity:1}}.sd-animate-slide-from-left{animation:1s ease-out 0s 1 normal none running sd-slide-from-left}.sd-animate-slide-from-right{animation:1s ease-out 0s 1 normal none running sd-slide-from-right}.sd-animate-grow100{animation:1s ease-out 0s 1 normal none running sd-grow100}.sd-animate-grow50{animation:1s ease-out 0s 1 normal none running sd-grow50}.sd-animate-grow50-rot20{animation:1s ease-out 0s 1 normal none running sd-grow50-rot20}.sd-badge{display:inline-block;padding:.35em .65em;font-size:.75em;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.sd-badge:empty{display:none}a.sd-badge{text-decoration:none}.sd-btn .sd-badge{position:relative;top:-1px}.sd-btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;cursor:pointer;display:inline-block;font-weight:400;font-size:1rem;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;vertical-align:middle;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.sd-btn:hover{text-decoration:none}@media(prefers-reduced-motion: reduce){.sd-btn{transition:none}}.sd-btn-primary,.sd-btn-outline-primary:hover,.sd-btn-outline-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-primary:hover,.sd-btn-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary-highlight) !important;border-color:var(--sd-color-primary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-primary{color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary,.sd-btn-outline-secondary:hover,.sd-btn-outline-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary:hover,.sd-btn-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary-highlight) !important;border-color:var(--sd-color-secondary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-secondary{color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success,.sd-btn-outline-success:hover,.sd-btn-outline-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success:hover,.sd-btn-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success-highlight) !important;border-color:var(--sd-color-success-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-success{color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info,.sd-btn-outline-info:hover,.sd-btn-outline-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info:hover,.sd-btn-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info-highlight) !important;border-color:var(--sd-color-info-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-info{color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning,.sd-btn-outline-warning:hover,.sd-btn-outline-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning:hover,.sd-btn-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning-highlight) !important;border-color:var(--sd-color-warning-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-warning{color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger,.sd-btn-outline-danger:hover,.sd-btn-outline-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger:hover,.sd-btn-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger-highlight) !important;border-color:var(--sd-color-danger-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-danger{color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light,.sd-btn-outline-light:hover,.sd-btn-outline-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light:hover,.sd-btn-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light-highlight) !important;border-color:var(--sd-color-light-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-light{color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted,.sd-btn-outline-muted:hover,.sd-btn-outline-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted:hover,.sd-btn-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted-highlight) !important;border-color:var(--sd-color-muted-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-muted{color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark,.sd-btn-outline-dark:hover,.sd-btn-outline-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark:hover,.sd-btn-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark-highlight) !important;border-color:var(--sd-color-dark-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-dark{color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black,.sd-btn-outline-black:hover,.sd-btn-outline-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black:hover,.sd-btn-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black-highlight) !important;border-color:var(--sd-color-black-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-black{color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white,.sd-btn-outline-white:hover,.sd-btn-outline-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white:hover,.sd-btn-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white-highlight) !important;border-color:var(--sd-color-white-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-white{color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.sd-hide-link-text{font-size:0}.sd-octicon,.sd-material-icon{display:inline-block;fill:currentColor;vertical-align:middle}.sd-avatar-xs{border-radius:50%;object-fit:cover;object-position:center;width:1rem;height:1rem}.sd-avatar-sm{border-radius:50%;object-fit:cover;object-position:center;width:3rem;height:3rem}.sd-avatar-md{border-radius:50%;object-fit:cover;object-position:center;width:5rem;height:5rem}.sd-avatar-lg{border-radius:50%;object-fit:cover;object-position:center;width:7rem;height:7rem}.sd-avatar-xl{border-radius:50%;object-fit:cover;object-position:center;width:10rem;height:10rem}.sd-avatar-inherit{border-radius:50%;object-fit:cover;object-position:center;width:inherit;height:inherit}.sd-avatar-initial{border-radius:50%;object-fit:cover;object-position:center;width:initial;height:initial}.sd-card{background-clip:border-box;background-color:var(--sd-color-card-background);border:1px solid var(--sd-color-card-border);border-radius:.25rem;color:var(--sd-color-card-text);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;position:relative;word-wrap:break-word}.sd-card>hr{margin-left:0;margin-right:0}.sd-card-hover:hover{border-color:var(--sd-color-card-border-hover);transform:scale(1.01)}.sd-card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem 1rem}.sd-card-title{margin-bottom:.5rem}.sd-card-subtitle{margin-top:-0.25rem;margin-bottom:0}.sd-card-text:last-child{margin-bottom:0}.sd-card-link:hover{text-decoration:none}.sd-card-link+.card-link{margin-left:1rem}.sd-card-header{padding:.5rem 1rem;margin-bottom:0;background-color:var(--sd-color-card-header);border-bottom:1px solid var(--sd-color-card-border)}.sd-card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.sd-card-footer{padding:.5rem 1rem;background-color:var(--sd-color-card-footer);border-top:1px solid var(--sd-color-card-border)}.sd-card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.sd-card-header-tabs{margin-right:-0.5rem;margin-bottom:-0.5rem;margin-left:-0.5rem;border-bottom:0}.sd-card-header-pills{margin-right:-0.5rem;margin-left:-0.5rem}.sd-card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom,.sd-card-img-top{width:100%}.sd-card-img,.sd-card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom{border-bottom-left-radius:calc(0.25rem - 1px);border-bottom-right-radius:calc(0.25rem - 1px)}.sd-cards-carousel{width:100%;display:flex;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row;overflow-x:hidden;scroll-snap-type:x mandatory}.sd-cards-carousel.sd-show-scrollbar{overflow-x:auto}.sd-cards-carousel:hover,.sd-cards-carousel:focus{overflow-x:auto}.sd-cards-carousel>.sd-card{flex-shrink:0;scroll-snap-align:start}.sd-cards-carousel>.sd-card:not(:last-child){margin-right:3px}.sd-card-cols-1>.sd-card{width:90%}.sd-card-cols-2>.sd-card{width:45%}.sd-card-cols-3>.sd-card{width:30%}.sd-card-cols-4>.sd-card{width:22.5%}.sd-card-cols-5>.sd-card{width:18%}.sd-card-cols-6>.sd-card{width:15%}.sd-card-cols-7>.sd-card{width:12.8571428571%}.sd-card-cols-8>.sd-card{width:11.25%}.sd-card-cols-9>.sd-card{width:10%}.sd-card-cols-10>.sd-card{width:9%}.sd-card-cols-11>.sd-card{width:8.1818181818%}.sd-card-cols-12>.sd-card{width:7.5%}.sd-container,.sd-container-fluid,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container-xl{margin-left:auto;margin-right:auto;padding-left:var(--sd-gutter-x, 0.75rem);padding-right:var(--sd-gutter-x, 0.75rem);width:100%}@media(min-width: 576px){.sd-container-sm,.sd-container{max-width:540px}}@media(min-width: 768px){.sd-container-md,.sd-container-sm,.sd-container{max-width:720px}}@media(min-width: 992px){.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:960px}}@media(min-width: 1200px){.sd-container-xl,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:1140px}}.sd-row{--sd-gutter-x: 1.5rem;--sd-gutter-y: 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(var(--sd-gutter-y) * -1);margin-right:calc(var(--sd-gutter-x) * -0.5);margin-left:calc(var(--sd-gutter-x) * -0.5)}.sd-row>*{box-sizing:border-box;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--sd-gutter-x) * 0.5);padding-left:calc(var(--sd-gutter-x) * 0.5);margin-top:var(--sd-gutter-y)}.sd-col{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-auto>*{flex:0 0 auto;width:auto}.sd-row-cols-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}@media(min-width: 576px){.sd-col-sm{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-sm-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-sm-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-sm-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-sm-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-sm-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-sm-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-sm-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-sm-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-sm-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-sm-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-sm-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-sm-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-sm-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 768px){.sd-col-md{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-md-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-md-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-md-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-md-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-md-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-md-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-md-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-md-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-md-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-md-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-md-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-md-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-md-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 992px){.sd-col-lg{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-lg-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-lg-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-lg-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-lg-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-lg-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-lg-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-lg-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-lg-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-lg-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-lg-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-lg-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-lg-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-lg-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 1200px){.sd-col-xl{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-xl-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-xl-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-xl-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-xl-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-xl-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-xl-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-xl-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-xl-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-xl-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-xl-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-xl-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-xl-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-xl-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}.sd-col-auto{flex:0 0 auto;-ms-flex:0 0 auto;width:auto}.sd-col-1{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}.sd-col-2{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-col-3{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-col-4{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-col-5{flex:0 0 auto;-ms-flex:0 0 auto;width:41.6666666667%}.sd-col-6{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-col-7{flex:0 0 auto;-ms-flex:0 0 auto;width:58.3333333333%}.sd-col-8{flex:0 0 auto;-ms-flex:0 0 auto;width:66.6666666667%}.sd-col-9{flex:0 0 auto;-ms-flex:0 0 auto;width:75%}.sd-col-10{flex:0 0 auto;-ms-flex:0 0 auto;width:83.3333333333%}.sd-col-11{flex:0 0 auto;-ms-flex:0 0 auto;width:91.6666666667%}.sd-col-12{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-g-0,.sd-gy-0{--sd-gutter-y: 0}.sd-g-0,.sd-gx-0{--sd-gutter-x: 0}.sd-g-1,.sd-gy-1{--sd-gutter-y: 0.25rem}.sd-g-1,.sd-gx-1{--sd-gutter-x: 0.25rem}.sd-g-2,.sd-gy-2{--sd-gutter-y: 0.5rem}.sd-g-2,.sd-gx-2{--sd-gutter-x: 0.5rem}.sd-g-3,.sd-gy-3{--sd-gutter-y: 1rem}.sd-g-3,.sd-gx-3{--sd-gutter-x: 1rem}.sd-g-4,.sd-gy-4{--sd-gutter-y: 1.5rem}.sd-g-4,.sd-gx-4{--sd-gutter-x: 1.5rem}.sd-g-5,.sd-gy-5{--sd-gutter-y: 3rem}.sd-g-5,.sd-gx-5{--sd-gutter-x: 3rem}@media(min-width: 576px){.sd-col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-sm-0,.sd-gy-sm-0{--sd-gutter-y: 0}.sd-g-sm-0,.sd-gx-sm-0{--sd-gutter-x: 0}.sd-g-sm-1,.sd-gy-sm-1{--sd-gutter-y: 0.25rem}.sd-g-sm-1,.sd-gx-sm-1{--sd-gutter-x: 0.25rem}.sd-g-sm-2,.sd-gy-sm-2{--sd-gutter-y: 0.5rem}.sd-g-sm-2,.sd-gx-sm-2{--sd-gutter-x: 0.5rem}.sd-g-sm-3,.sd-gy-sm-3{--sd-gutter-y: 1rem}.sd-g-sm-3,.sd-gx-sm-3{--sd-gutter-x: 1rem}.sd-g-sm-4,.sd-gy-sm-4{--sd-gutter-y: 1.5rem}.sd-g-sm-4,.sd-gx-sm-4{--sd-gutter-x: 1.5rem}.sd-g-sm-5,.sd-gy-sm-5{--sd-gutter-y: 3rem}.sd-g-sm-5,.sd-gx-sm-5{--sd-gutter-x: 3rem}}@media(min-width: 768px){.sd-col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-md-0,.sd-gy-md-0{--sd-gutter-y: 0}.sd-g-md-0,.sd-gx-md-0{--sd-gutter-x: 0}.sd-g-md-1,.sd-gy-md-1{--sd-gutter-y: 0.25rem}.sd-g-md-1,.sd-gx-md-1{--sd-gutter-x: 0.25rem}.sd-g-md-2,.sd-gy-md-2{--sd-gutter-y: 0.5rem}.sd-g-md-2,.sd-gx-md-2{--sd-gutter-x: 0.5rem}.sd-g-md-3,.sd-gy-md-3{--sd-gutter-y: 1rem}.sd-g-md-3,.sd-gx-md-3{--sd-gutter-x: 1rem}.sd-g-md-4,.sd-gy-md-4{--sd-gutter-y: 1.5rem}.sd-g-md-4,.sd-gx-md-4{--sd-gutter-x: 1.5rem}.sd-g-md-5,.sd-gy-md-5{--sd-gutter-y: 3rem}.sd-g-md-5,.sd-gx-md-5{--sd-gutter-x: 3rem}}@media(min-width: 992px){.sd-col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-lg-0,.sd-gy-lg-0{--sd-gutter-y: 0}.sd-g-lg-0,.sd-gx-lg-0{--sd-gutter-x: 0}.sd-g-lg-1,.sd-gy-lg-1{--sd-gutter-y: 0.25rem}.sd-g-lg-1,.sd-gx-lg-1{--sd-gutter-x: 0.25rem}.sd-g-lg-2,.sd-gy-lg-2{--sd-gutter-y: 0.5rem}.sd-g-lg-2,.sd-gx-lg-2{--sd-gutter-x: 0.5rem}.sd-g-lg-3,.sd-gy-lg-3{--sd-gutter-y: 1rem}.sd-g-lg-3,.sd-gx-lg-3{--sd-gutter-x: 1rem}.sd-g-lg-4,.sd-gy-lg-4{--sd-gutter-y: 1.5rem}.sd-g-lg-4,.sd-gx-lg-4{--sd-gutter-x: 1.5rem}.sd-g-lg-5,.sd-gy-lg-5{--sd-gutter-y: 3rem}.sd-g-lg-5,.sd-gx-lg-5{--sd-gutter-x: 3rem}}@media(min-width: 1200px){.sd-col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-xl-0,.sd-gy-xl-0{--sd-gutter-y: 0}.sd-g-xl-0,.sd-gx-xl-0{--sd-gutter-x: 0}.sd-g-xl-1,.sd-gy-xl-1{--sd-gutter-y: 0.25rem}.sd-g-xl-1,.sd-gx-xl-1{--sd-gutter-x: 0.25rem}.sd-g-xl-2,.sd-gy-xl-2{--sd-gutter-y: 0.5rem}.sd-g-xl-2,.sd-gx-xl-2{--sd-gutter-x: 0.5rem}.sd-g-xl-3,.sd-gy-xl-3{--sd-gutter-y: 1rem}.sd-g-xl-3,.sd-gx-xl-3{--sd-gutter-x: 1rem}.sd-g-xl-4,.sd-gy-xl-4{--sd-gutter-y: 1.5rem}.sd-g-xl-4,.sd-gx-xl-4{--sd-gutter-x: 1.5rem}.sd-g-xl-5,.sd-gy-xl-5{--sd-gutter-y: 3rem}.sd-g-xl-5,.sd-gx-xl-5{--sd-gutter-x: 3rem}}.sd-flex-row-reverse{flex-direction:row-reverse !important}details.sd-dropdown{position:relative}details.sd-dropdown .sd-summary-title{font-weight:700;padding-right:3em !important;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}details.sd-dropdown:hover{cursor:pointer}details.sd-dropdown .sd-summary-content{cursor:default}details.sd-dropdown summary{list-style:none;padding:1em}details.sd-dropdown summary .sd-octicon.no-title{vertical-align:middle}details.sd-dropdown[open] summary .sd-octicon.no-title{visibility:hidden}details.sd-dropdown summary::-webkit-details-marker{display:none}details.sd-dropdown summary:focus{outline:none}details.sd-dropdown .sd-summary-icon{margin-right:.5em}details.sd-dropdown .sd-summary-icon svg{opacity:.8}details.sd-dropdown summary:hover .sd-summary-up svg,details.sd-dropdown summary:hover .sd-summary-down svg{opacity:1;transform:scale(1.1)}details.sd-dropdown .sd-summary-up svg,details.sd-dropdown .sd-summary-down svg{display:block;opacity:.6}details.sd-dropdown .sd-summary-up,details.sd-dropdown .sd-summary-down{pointer-events:none;position:absolute;right:1em;top:1em}details.sd-dropdown[open]>.sd-summary-title .sd-summary-down{visibility:hidden}details.sd-dropdown:not([open])>.sd-summary-title .sd-summary-up{visibility:hidden}details.sd-dropdown:not([open]).sd-card{border:none}details.sd-dropdown:not([open])>.sd-card-header{border:1px solid var(--sd-color-card-border);border-radius:.25rem}details.sd-dropdown.sd-fade-in[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out;animation:sd-fade-in .5s ease-in-out}details.sd-dropdown.sd-fade-in-slide-down[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out}.sd-col>.sd-dropdown{width:100%}.sd-summary-content>.sd-tab-set:first-child{margin-top:0}@keyframes sd-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes sd-slide-down{0%{transform:translate(0, -10px)}100%{transform:translate(0, 0)}}.sd-tab-set{border-radius:.125rem;display:flex;flex-wrap:wrap;margin:1em 0;position:relative}.sd-tab-set>input{opacity:0;position:absolute}.sd-tab-set>input:checked+label{border-color:var(--sd-color-tabs-underline-active);color:var(--sd-color-tabs-label-active)}.sd-tab-set>input:checked+label+.sd-tab-content{display:block}.sd-tab-set>input:not(:checked)+label:hover{color:var(--sd-color-tabs-label-hover);border-color:var(--sd-color-tabs-underline-hover)}.sd-tab-set>input:focus+label{outline-style:auto}.sd-tab-set>input:not(.focus-visible)+label{outline:none;-webkit-tap-highlight-color:transparent}.sd-tab-set>label{border-bottom:.125rem solid transparent;margin-bottom:0;color:var(--sd-color-tabs-label-inactive);border-color:var(--sd-color-tabs-underline-inactive);cursor:pointer;font-size:var(--sd-fontsize-tabs-label);font-weight:700;padding:1em 1.25em .5em;transition:color 250ms;width:auto;z-index:1}html .sd-tab-set>label:hover{color:var(--sd-color-tabs-label-active)}.sd-col>.sd-tab-set{width:100%}.sd-tab-content{box-shadow:0 -0.0625rem var(--sd-color-tabs-overline),0 .0625rem var(--sd-color-tabs-underline);display:none;order:99;padding-bottom:.75rem;padding-top:.75rem;width:100%}.sd-tab-content>:first-child{margin-top:0 !important}.sd-tab-content>:last-child{margin-bottom:0 !important}.sd-tab-content>.sd-tab-set{margin:0}.sd-sphinx-override,.sd-sphinx-override *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sd-sphinx-override p{margin-top:0}:root{--sd-color-primary: #0071bc;--sd-color-secondary: #6c757d;--sd-color-success: #28a745;--sd-color-info: #17a2b8;--sd-color-warning: #f0b37e;--sd-color-danger: #dc3545;--sd-color-light: #f8f9fa;--sd-color-muted: #6c757d;--sd-color-dark: #212529;--sd-color-black: black;--sd-color-white: white;--sd-color-primary-highlight: #0060a0;--sd-color-secondary-highlight: #5c636a;--sd-color-success-highlight: #228e3b;--sd-color-info-highlight: #148a9c;--sd-color-warning-highlight: #cc986b;--sd-color-danger-highlight: #bb2d3b;--sd-color-light-highlight: #d3d4d5;--sd-color-muted-highlight: #5c636a;--sd-color-dark-highlight: #1c1f23;--sd-color-black-highlight: black;--sd-color-white-highlight: #d9d9d9;--sd-color-primary-text: #fff;--sd-color-secondary-text: #fff;--sd-color-success-text: #fff;--sd-color-info-text: #fff;--sd-color-warning-text: #212529;--sd-color-danger-text: #fff;--sd-color-light-text: #212529;--sd-color-muted-text: #fff;--sd-color-dark-text: #fff;--sd-color-black-text: #fff;--sd-color-white-text: #212529;--sd-color-shadow: rgba(0, 0, 0, 0.15);--sd-color-card-border: rgba(0, 0, 0, 0.125);--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);--sd-color-card-background: transparent;--sd-color-card-text: inherit;--sd-color-card-header: transparent;--sd-color-card-footer: transparent;--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);--sd-color-tabs-underline-inactive: transparent;--sd-color-tabs-overline: rgb(222, 222, 222);--sd-color-tabs-underline: rgb(222, 222, 222);--sd-fontsize-tabs-label: 1rem} diff --git a/review/pr-1877/_sphinx_design_static/design-tabs.js b/review/pr-1877/_sphinx_design_static/design-tabs.js new file mode 100644 index 00000000000..36b38cf0d91 --- /dev/null +++ b/review/pr-1877/_sphinx_design_static/design-tabs.js @@ -0,0 +1,27 @@ +var sd_labels_by_text = {}; + +function ready() { + const li = document.getElementsByClassName("sd-tab-label"); + for (const label of li) { + syncId = label.getAttribute("data-sync-id"); + if (syncId) { + label.onclick = onLabelClick; + if (!sd_labels_by_text[syncId]) { + sd_labels_by_text[syncId] = []; + } + sd_labels_by_text[syncId].push(label); + } + } +} + +function onLabelClick() { + // Activate other inputs with the same sync id. + syncId = this.getAttribute("data-sync-id"); + for (label of sd_labels_by_text[syncId]) { + if (label === this) continue; + label.previousElementSibling.checked = true; + } + window.localStorage.setItem("sphinx-design-last-tab", syncId); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/review/pr-1877/_static/NVIDIA-LogoBlack.svg b/review/pr-1877/_static/NVIDIA-LogoBlack.svg new file mode 100644 index 00000000000..c612396c71a --- /dev/null +++ b/review/pr-1877/_static/NVIDIA-LogoBlack.svg @@ -0,0 +1 @@ +NVIDIA-LogoBlack \ No newline at end of file diff --git a/review/pr-1877/_static/NVIDIA-LogoWhite.svg b/review/pr-1877/_static/NVIDIA-LogoWhite.svg new file mode 100644 index 00000000000..942ca3b2a04 --- /dev/null +++ b/review/pr-1877/_static/NVIDIA-LogoWhite.svg @@ -0,0 +1,58 @@ + + + + + + + NVIDIA-LogoBlack + + + + + diff --git a/review/pr-1877/_static/_sphinx_javascript_frameworks_compat.js b/review/pr-1877/_static/_sphinx_javascript_frameworks_compat.js new file mode 100644 index 00000000000..8549469dc29 --- /dev/null +++ b/review/pr-1877/_static/_sphinx_javascript_frameworks_compat.js @@ -0,0 +1,134 @@ +/* + * _sphinx_javascript_frameworks_compat.js + * ~~~~~~~~~~ + * + * Compatability shim for jQuery and underscores.js. + * + * WILL BE REMOVED IN Sphinx 6.0 + * xref RemovedInSphinx60Warning + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + + +/** + * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL + */ +jQuery.urldecode = function(x) { + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} diff --git a/review/pr-1877/_static/basic.css b/review/pr-1877/_static/basic.css new file mode 100644 index 00000000000..18495ea0884 --- /dev/null +++ b/review/pr-1877/_static/basic.css @@ -0,0 +1,900 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 270px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/review/pr-1877/_static/css/custom.css b/review/pr-1877/_static/css/custom.css new file mode 100644 index 00000000000..11179bfd2b3 --- /dev/null +++ b/review/pr-1877/_static/css/custom.css @@ -0,0 +1,485 @@ +/* +# Copyright 2022, NVIDIA CORPORATION & AFFILIATES. 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 NVIDIA CORPORATION 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 ``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. +*/ + +/* Parts of this are adapted from the NVIDIA Omniverse Docs Sphinx Theme */ + +/* Set up for old browsers*/ +@supports not (font-variation-settings: normal) { + @font-face { + font-family: "NVIDIA"; + src: url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Lt.woff") format("woff"), + url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Lt.woff2") format("woff2"); + font-weight: 300; + font-style: normal; + } + @font-face { + font-family: "NVIDIA"; + src: url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Rg.woff") format("woff"), + url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Rg.woff2") format("woff2"); + font-weight: 400; + font-style: normal; + } + @font-face { + font-family: "NVIDIA"; + src: url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Md.woff") format("woff"), + url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Md.woff2") format("woff2"); + font-weight: 500; + font-style: normal; + } + @font-face { + font-family: "NVIDIA"; + src: url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Bd.woff") format("woff"), + url("https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/NVIDIASans_W_Bd.woff2") format("woff2"); + font-weight: 700; + font-style: normal; + } +} + +/* Set up for modern browsers, all weights */ +@supports (font-variation-settings: normal) { + @font-face { + font-family: 'NVIDIA'; + src: url('https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/var/NVIDIASansVF_W_Wght.woff2') format('woff2 supports variations'), + url('https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/var/NVIDIASansVF_W_Wght.woff2') format('woff2-variations'); + font-weight: 100 1000; + font-stretch: 25% 151%; + font-style: normal; + } + @font-face{ + font-family:'NVIDIA'; + src:url('https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/var/NVIDIASansVF_Wght_W_Italic.woff2') format('woff2 supports variations'), + url('https://images.nvidia.com/etc/designs/nvidiaGDC/clientlibs_base/fonts/nvidia-sans/GLOBAL/var/NVIDIASansVF_Wght_W_Italic.woff2') format('woff2-variations'); + font-weight:100 1000; + font-stretch:25% 151%; + font-style:italic; + } +} + +:root +{ + /* nv branding */ + --nv-green: #76b900; + --nv-green-illuminate: #76d300; /* button state - hover */ + --nv-black: #000000; + --nv-white: #ffffff; + --nv-green-2: #004831; + + --nv-success: var(--nv-green); + --nv-error: #f44336; + + --nv-font-face: NVIDIA,Arial,Helvetica,Sans-Serif; + --nv-font-face-mono: SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace; + + /* nv branding: light theme */ + --text: #1a1a1a; + --background-default: #ffffff; + --background-alternate: #eeeeee; + --ui-and-graphics: #999999; + + --white: #ffffff; + --gray-1: #f7f7f7; + --gray-2: #eeeeee; + --gray-3: #dddddd; + --gray-4: #cccccc; + + /* nv branding: light theme mobile (closely matches our old font sizes) */ + --h1-color: var(--nv-green); + --h1-font-weight: 100; + --h1-letter-spacing: -0.02em; + --h1-font-size: 36px; + --h1-line-height: 1em; + --h1-text-transform: uppercase; + + --h2-color: var(--nv-green); + --h2-font-weight: 100; + --h2-letter-spacing: -0.02em; + --h2-font-size: 24px; + --h2-line-height: 1em; + --h2-text-transform: uppercase; + + --h3-color: var(--nv-green); + --h3-font-weight: 100; + --h3-letter-spacing: -0.02em; + --h3-font-size: 21px; + --h3-line-height: 1em; + --h3-text-transform: uppercase; + + --h4-color: var(--nv-green); + --h4-font-weight: 100; + --h4-letter-spacing: -0.02em; + --h4-font-size: 18px; + --h4-line-height: 1em; + --h4-text-transform: uppercase; + + --h5-color: var(--nv-green); + --h5-font-size: var(--body-font-size); + + --h6-color: var(--nv-green); + --h6-font-weight: 400; + + --body-font-color: var(--text); + --body-font-weight: normal; + --body-font-size: 16px; + --body-line-height: 1.5em; + + --small-font-color: var(--ui-and-graphics); + --small-font-weight: normal; + --small-font-size: 12px; + --small-line-height: 1.25em; + + --ul-font-color: var(--text); + --ul-font-weight: normal; + --ul-font-size: 16px; + --ul-line-height: 2em; + --ul-marker-font-face: FontAwesome; + --ul-marker-content: '\f105 \00a0 \00a0'; + + --ol-font-color: var(--text); + --ol-font-weight: normal; + --ol-font-size: 16px; + --ol-line-height: 2em; + --ol-list-style-type: decimal; + --ol-ol-list-style-type: upper-alpha; + --ol-ol-ol-list-style-type: decimal; /* not specified in style guide */ + + --disabled-font-color: var(--gray-4); + --disabled-font-weight: normal; + --disabled-font-size: 16px; + --disabled-line-height: 1em; /* style guide says 16px */ + + --error-font-color: var(--nv-error); + --error-font-weight: normal; + --error-font-size: 16px; + --error-line-height: 1em; /* style guide says 16px */ + + --success-font-color: var(--nv-success); + --success-font-weight: normal; + --success-font-size: 16px; + --success-line-height: 1em; /* style guide says 16px */ + + /* omni-style */ + --sidebar-color: #000000; + --sidebar-alt-color: #333333; + --sidebar-headline-color: var(--nv-green); + --sidebar-text-color: #cccccc; + + --table-background-header: var(--nv-black); + --table-background-alternate: var(--background-alternate); /* for alternating rows */ + --table-text: var(--text); + --table-border: var(--ui-and-graphics); + --table-border-header: var(--gray-3); + + /* this is off-brand, but `uppercase` makes headings with source code look bad. */ + --h1-text-transform: none; + --h2-text-transform: none; + --h3-text-transform: none; + --h4-text-transform: none; + + --h3-font-weight: normal; /* this is off-brand and overrides the above definition */ + + --note-background-color: var(--nv-green); + --note-background-alt-color: #cccccc; + + --important-background-color: #f44336; + --important-background-alt-color: #cccccc; + + --link-color: var(--nv-green); + --link-visited-color: var(--nv-green); + --link-hover-color: var(--nv-green-illuminate); + + --background-color: var(--background-default); + + /* template T* tryAcquireInterface(const void* pluginInterface) */ + --api-member-header-background-color: var(--gray-2); + --api-member-header-border-color: var(--sidebar-headline-color); + --api-member-header-text-color: var(--text); + --api-member-header-link-color: var(--link-color); + + --api-member-background-color: var(--gray-1); + + /* struct carb::Framework */ + --api-header-text-color: var(--nv-green); + --api-header-border-color: var(--ui-and-graphics); + + /* sphinx-design color modifications */ + --sd-color-tabs-label-active: var(--nv-green); + --sd-color-tabs-underline-active: var(--nv-green); + + --sd-color-tabs-label-hover: var(--nv-green-illuminate); + --sd-color-tabs-underline-hover: var(--nv-green-illuminate); +} + +/* Custom Styles */ +:root { + --pst-font-size-base: none; + --pst-color-admonition-note: var(--pst-color-primary); + --pst-color-admonition-default: var(--pst-color-primary); + --pst-color-info: 255, 193, 7; + --pst-color-admonition-tip: var(--pst-color-info); + --pst-color-admonition-hint: var(--pst-color-info); + --pst-color-admonition-important: var(--pst-color-info); + --pst-color-warning: 245, 162, 82; + --pst-color-danger: 230, 101, 129; + --pst-color-admonition-warning: var(--pst-color-danger); + --pst-color-link: 118, 185, 0; + --pst-color-inline-code: 92, 22, 130; + --font-family-sans-serif: NVIDIA Sans, Helvetica, Arial, var(--pst-font-family-base-system); + --pst-font-family-heading: NVIDIA Sans, Helvetica, Arial, var(--pst-font-family-base-system); + --pst-font-family-monospace: Roboto Mono, var(--pst-font-family-monospace-system); + font-family: NVIDIA Sans, Helvetica, Arial,Sans-serif; +} + + +html[data-theme="light"] { + --pst-color-primary: var(--nv-green); +} +html[data-theme="dark"] { + --pst-color-primary: var(--nv-green); +} + +/**********************************************************************************************************************/ +/* Standard Text Formatting */ +/**********************************************************************************************************************/ + +/* Headline Formatting */ +.bd-container h1 +{ + color: var(--h1-color); + + font-weight: var(--h1-font-weight); + font-size: var(--h1-font-size); + font-style: normal; + + line-height: var(--h1-line-height); + margin-top: 0.75em; + margin-bottom: 0.75em !important; /* override RTD theme */ + + text-transform: var(--h1-text-transform); +} + +.bd-container h2 +{ + color: var(--h2-color); + + font-weight: var(--h2-font-weight); + font-size: var(--h2-font-size); + font-style: normal; + + line-height: var(--h2-line-height); + margin-top: 1.25em; + margin-bottom: 0.5em !important; /* override RTD theme */ + + text-transform: var(--h2-text-transform); +} + +.bd-container h3 +{ + color: var(--h3-color); + + font-weight: var(--h3-font-weight); + font-size: var(--h3-font-size); + font-style: normal; + + line-height: var(--h3-line-height); + margin-top: 1.25em; + margin-bottom: 0.5em !important; /* override RTD theme */ + + text-transform: var(--h3-text-transform); +} + +.bd-container h4 +{ + color: var(--h4-color); + + font-weight: var(--h4-font-weight); + font-size: var(--h4-font-size); + font-style: normal; + + line-height: var(--h4-line-height); + margin-top: 1.25em; + margin-bottom: 0.5em !important; /* override RTD theme */ + + text-transform: var(--h4-text-transform); +} + +.bd-container h5 +{ + color: var(--h5-color); + + font-size: var(--h5-font-size); +} + +.bd-container h6 +{ + color: var(--h6-color); + + font-weight: var(--h6-font-weight); +} + +/* Math should inherit its color */ +span[id*=MathJax-Span] +{ + color: inherit; +} + +/* text highlighted by search */ +.rst-content .highlighted +{ + background: #f1c40f3b; + box-shadow: 0 0 0 1px #f1c40f; + display: inline; + font-weight: inherit; +} + +/* a local table-of-contents messes with heading colors. make sure to use the regular heading colors */ +.rst-content .toc-backref +{ + color: inherit; +} + +/* make links to function looks like other literals */ +.rst-content code.xref, +.rst-content tt.xref, +a .rst-content code, +a .rst-content tt +{ + color: #e74c3c; + font-weight: inherit; +} + +/* Link Colors */ +a +{ + color: var(--link-color); +} + +a:visited +{ + color: var(--link-visited-color); +} + +a:hover +{ + color: var(--link-hover-color); +} + +/* follow branding guide for small footer text */ +footer p +{ + color: var(--small-font-color); + font-weight: var(--small-font-weight); + font-size: var(--small-font-size); + line-height: var(--small-line-height); +} + +/* add nvidia logo (like www.nvidia.com) */ +html[data-theme="light"] footer.bd-footer-content p.copyright::before +{ + content: url(../NVIDIA-LogoBlack.svg); + display: block; + width: 110px; + margin: 0px; + position: relative; + left: -9px; +} + +/* add nvidia logo (like www.nvidia.com) */ +html[data-theme="dark"] footer.bd-footer-content p.copyright::before +{ + content: url(../NVIDIA-LogoWhite.svg); + display: block; + width: 110px; + margin: 0px; + position: relative; + left: -9px; +} + + +/**********************************************************************************************************************/ +/* Lists */ +/**********************************************************************************************************************/ + +/* unordered list should have a nv-green > */ +.rst-content section ul:not(.treeView):not(.collapsibleList) li:not(.collapsibleListClosed):not(.collapsibleListOpen):not(.lastChild)::marker, +.rst-content .toctree-wrapper ul li::marker, +.wy-plain-list-disc li::marker, +article ul li::marker +{ + font-family: var(--ul-marker-font-face); + content: var(--ul-marker-content); + color: var(--nv-green); + font-weight: 600; +} + +/* top-level ordered list should have a nv-green number */ +.rst-content section ol li::marker, +.rst-content ol.arabic li::marker, +.wy-plain-list-decimal li::marker, +article ol li::marker +{ + color: var(--nv-green); + font-weight: 600; + list-style: var(--ol-list-style-type); +} + +/* second-level ordered list should have a nv-green uppercase letter */ +.rst-content section ol ol li, +.rst-content ol.arabic ol.arabic li, +.wy-plain-list-decimal ol ol li, +article ol ol li +{ + list-style: var(--ol-ol-list-style-type); +} + +/* third-level ordered lists aren't in the branding guide. let's use numbers. */ +.rst-content section ol ol ol li, +.rst-content ol.arabic ol.arabic ol li, +.wy-plain-list-decimal ol ol ol li, +article ol ol ol li +{ + list-style: var(--ol-ol-ol-list-style-type); +} + +/* start the first paragraph immediately (don't add space at the top) */ +dd p:first-child +{ + margin-top: 0px; +} + +footer div p { + font-size: 80%; + padding-top: 1em; +} + +footer div p a { + color: var(--small-font-color); +} + +footer div p a:hover { + color: var(--small-font-color); +} diff --git a/review/pr-1877/_static/css/versions.css b/review/pr-1877/_static/css/versions.css new file mode 100644 index 00000000000..cafebc54bab --- /dev/null +++ b/review/pr-1877/_static/css/versions.css @@ -0,0 +1,140 @@ +/* Version Switcher */ + +.rst-versions { + flex-align: bottom; + bottom: 0; + left: 0; + z-index: 400 +} + +.rst-versions a { + color: var(--nv-green); + text-decoration: none +} + +.rst-versions .rst-badge-small { + display: none +} + +.rst-versions .rst-current-version { + padding: 12px; + display: block; + text-align: right; + font-size: 90%; + cursor: pointer; + border-top: 1px solid rgba(0,0,0,.1); + *zoom:1 +} + +.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after { + display: table; + content: "" +} + +.rst-versions .rst-current-version:after { + clear: both +} + +.rst-versions .rst-current-version .fa-book { + float: left +} + +.rst-versions .rst-current-version .icon-book { + float: left +} + +.rst-versions .rst-current-version.rst-out-of-date { + background-color: #E74C3C; + color: #fff +} + +.rst-versions .rst-current-version.rst-active-old-version { + background-color: #F1C40F; + color: #000 +} + +.rst-versions.shift-up { + height: auto; + max-height: 100% +} + +.rst-versions.shift-up .rst-other-versions { + display: block +} + +.rst-versions .rst-other-versions { + font-size: 90%; + padding: 12px; + color: gray; + display: none +} + +.rst-versions .rst-other-versions hr { + display: block; + height: 1px; + border: 0; + margin: 20px 0; + padding: 0; + border-top: solid 1px #413d3d +} + +.rst-versions .rst-other-versions dd { + display: inline-block; + margin: 0 +} + +.rst-versions .rst-other-versions dd a { + display: inline-block; + padding: 6px; + color: var(--nv-green); + font-weight: 500; +} + +.rst-versions.rst-badge { + width: auto; + bottom: 20px; + right: 20px; + left: auto; + border: none; + max-width: 300px +} + +.rst-versions.rst-badge .icon-book { + float: none +} + +.rst-versions.rst-badge .fa-book { + float: none +} + +.rst-versions.rst-badge.shift-up .rst-current-version { + text-align: right +} + +.rst-versions.rst-badge.shift-up .rst-current-version .fa-book { + float: left +} + +.rst-versions.rst-badge.shift-up .rst-current-version .icon-book { + float: left +} + +.rst-versions.rst-badge .rst-current-version { + width: auto; + height: 30px; + line-height: 30px; + padding: 0 6px; + display: block; + text-align: center +} + +@media screen and (max-width: 768px) { + .rst-versions { + width:85%; + display: none + } + + .rst-versions.shift { + display: block + } +} diff --git a/review/pr-1877/_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css b/review/pr-1877/_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css new file mode 100644 index 00000000000..eb19f698afc --- /dev/null +++ b/review/pr-1877/_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css @@ -0,0 +1 @@ +.sd-bg-primary{background-color:var(--sd-color-primary) !important}.sd-bg-text-primary{color:var(--sd-color-primary-text) !important}button.sd-bg-primary:focus,button.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}a.sd-bg-primary:focus,a.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}.sd-bg-secondary{background-color:var(--sd-color-secondary) !important}.sd-bg-text-secondary{color:var(--sd-color-secondary-text) !important}button.sd-bg-secondary:focus,button.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}a.sd-bg-secondary:focus,a.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}.sd-bg-success{background-color:var(--sd-color-success) !important}.sd-bg-text-success{color:var(--sd-color-success-text) !important}button.sd-bg-success:focus,button.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}a.sd-bg-success:focus,a.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}.sd-bg-info{background-color:var(--sd-color-info) !important}.sd-bg-text-info{color:var(--sd-color-info-text) !important}button.sd-bg-info:focus,button.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}a.sd-bg-info:focus,a.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}.sd-bg-warning{background-color:var(--sd-color-warning) !important}.sd-bg-text-warning{color:var(--sd-color-warning-text) !important}button.sd-bg-warning:focus,button.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}a.sd-bg-warning:focus,a.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}.sd-bg-danger{background-color:var(--sd-color-danger) !important}.sd-bg-text-danger{color:var(--sd-color-danger-text) !important}button.sd-bg-danger:focus,button.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}a.sd-bg-danger:focus,a.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}.sd-bg-light{background-color:var(--sd-color-light) !important}.sd-bg-text-light{color:var(--sd-color-light-text) !important}button.sd-bg-light:focus,button.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}a.sd-bg-light:focus,a.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}.sd-bg-muted{background-color:var(--sd-color-muted) !important}.sd-bg-text-muted{color:var(--sd-color-muted-text) !important}button.sd-bg-muted:focus,button.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}a.sd-bg-muted:focus,a.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}.sd-bg-dark{background-color:var(--sd-color-dark) !important}.sd-bg-text-dark{color:var(--sd-color-dark-text) !important}button.sd-bg-dark:focus,button.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}a.sd-bg-dark:focus,a.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}.sd-bg-black{background-color:var(--sd-color-black) !important}.sd-bg-text-black{color:var(--sd-color-black-text) !important}button.sd-bg-black:focus,button.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}a.sd-bg-black:focus,a.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}.sd-bg-white{background-color:var(--sd-color-white) !important}.sd-bg-text-white{color:var(--sd-color-white-text) !important}button.sd-bg-white:focus,button.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}a.sd-bg-white:focus,a.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}.sd-text-primary,.sd-text-primary>p{color:var(--sd-color-primary) !important}a.sd-text-primary:focus,a.sd-text-primary:hover{color:var(--sd-color-primary-highlight) !important}.sd-text-secondary,.sd-text-secondary>p{color:var(--sd-color-secondary) !important}a.sd-text-secondary:focus,a.sd-text-secondary:hover{color:var(--sd-color-secondary-highlight) !important}.sd-text-success,.sd-text-success>p{color:var(--sd-color-success) !important}a.sd-text-success:focus,a.sd-text-success:hover{color:var(--sd-color-success-highlight) !important}.sd-text-info,.sd-text-info>p{color:var(--sd-color-info) !important}a.sd-text-info:focus,a.sd-text-info:hover{color:var(--sd-color-info-highlight) !important}.sd-text-warning,.sd-text-warning>p{color:var(--sd-color-warning) !important}a.sd-text-warning:focus,a.sd-text-warning:hover{color:var(--sd-color-warning-highlight) !important}.sd-text-danger,.sd-text-danger>p{color:var(--sd-color-danger) !important}a.sd-text-danger:focus,a.sd-text-danger:hover{color:var(--sd-color-danger-highlight) !important}.sd-text-light,.sd-text-light>p{color:var(--sd-color-light) !important}a.sd-text-light:focus,a.sd-text-light:hover{color:var(--sd-color-light-highlight) !important}.sd-text-muted,.sd-text-muted>p{color:var(--sd-color-muted) !important}a.sd-text-muted:focus,a.sd-text-muted:hover{color:var(--sd-color-muted-highlight) !important}.sd-text-dark,.sd-text-dark>p{color:var(--sd-color-dark) !important}a.sd-text-dark:focus,a.sd-text-dark:hover{color:var(--sd-color-dark-highlight) !important}.sd-text-black,.sd-text-black>p{color:var(--sd-color-black) !important}a.sd-text-black:focus,a.sd-text-black:hover{color:var(--sd-color-black-highlight) !important}.sd-text-white,.sd-text-white>p{color:var(--sd-color-white) !important}a.sd-text-white:focus,a.sd-text-white:hover{color:var(--sd-color-white-highlight) !important}.sd-outline-primary{border-color:var(--sd-color-primary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-primary:focus,a.sd-outline-primary:hover{border-color:var(--sd-color-primary-highlight) !important}.sd-outline-secondary{border-color:var(--sd-color-secondary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-secondary:focus,a.sd-outline-secondary:hover{border-color:var(--sd-color-secondary-highlight) !important}.sd-outline-success{border-color:var(--sd-color-success) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-success:focus,a.sd-outline-success:hover{border-color:var(--sd-color-success-highlight) !important}.sd-outline-info{border-color:var(--sd-color-info) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-info:focus,a.sd-outline-info:hover{border-color:var(--sd-color-info-highlight) !important}.sd-outline-warning{border-color:var(--sd-color-warning) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-warning:focus,a.sd-outline-warning:hover{border-color:var(--sd-color-warning-highlight) !important}.sd-outline-danger{border-color:var(--sd-color-danger) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-danger:focus,a.sd-outline-danger:hover{border-color:var(--sd-color-danger-highlight) !important}.sd-outline-light{border-color:var(--sd-color-light) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-light:focus,a.sd-outline-light:hover{border-color:var(--sd-color-light-highlight) !important}.sd-outline-muted{border-color:var(--sd-color-muted) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-muted:focus,a.sd-outline-muted:hover{border-color:var(--sd-color-muted-highlight) !important}.sd-outline-dark{border-color:var(--sd-color-dark) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-dark:focus,a.sd-outline-dark:hover{border-color:var(--sd-color-dark-highlight) !important}.sd-outline-black{border-color:var(--sd-color-black) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-black:focus,a.sd-outline-black:hover{border-color:var(--sd-color-black-highlight) !important}.sd-outline-white{border-color:var(--sd-color-white) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-white:focus,a.sd-outline-white:hover{border-color:var(--sd-color-white-highlight) !important}.sd-bg-transparent{background-color:transparent !important}.sd-outline-transparent{border-color:transparent !important}.sd-text-transparent{color:transparent !important}.sd-p-0{padding:0 !important}.sd-pt-0,.sd-py-0{padding-top:0 !important}.sd-pr-0,.sd-px-0{padding-right:0 !important}.sd-pb-0,.sd-py-0{padding-bottom:0 !important}.sd-pl-0,.sd-px-0{padding-left:0 !important}.sd-p-1{padding:.25rem !important}.sd-pt-1,.sd-py-1{padding-top:.25rem !important}.sd-pr-1,.sd-px-1{padding-right:.25rem !important}.sd-pb-1,.sd-py-1{padding-bottom:.25rem !important}.sd-pl-1,.sd-px-1{padding-left:.25rem !important}.sd-p-2{padding:.5rem !important}.sd-pt-2,.sd-py-2{padding-top:.5rem !important}.sd-pr-2,.sd-px-2{padding-right:.5rem !important}.sd-pb-2,.sd-py-2{padding-bottom:.5rem !important}.sd-pl-2,.sd-px-2{padding-left:.5rem !important}.sd-p-3{padding:1rem !important}.sd-pt-3,.sd-py-3{padding-top:1rem !important}.sd-pr-3,.sd-px-3{padding-right:1rem !important}.sd-pb-3,.sd-py-3{padding-bottom:1rem !important}.sd-pl-3,.sd-px-3{padding-left:1rem !important}.sd-p-4{padding:1.5rem !important}.sd-pt-4,.sd-py-4{padding-top:1.5rem !important}.sd-pr-4,.sd-px-4{padding-right:1.5rem !important}.sd-pb-4,.sd-py-4{padding-bottom:1.5rem !important}.sd-pl-4,.sd-px-4{padding-left:1.5rem !important}.sd-p-5{padding:3rem !important}.sd-pt-5,.sd-py-5{padding-top:3rem !important}.sd-pr-5,.sd-px-5{padding-right:3rem !important}.sd-pb-5,.sd-py-5{padding-bottom:3rem !important}.sd-pl-5,.sd-px-5{padding-left:3rem !important}.sd-m-auto{margin:auto !important}.sd-mt-auto,.sd-my-auto{margin-top:auto !important}.sd-mr-auto,.sd-mx-auto{margin-right:auto !important}.sd-mb-auto,.sd-my-auto{margin-bottom:auto !important}.sd-ml-auto,.sd-mx-auto{margin-left:auto !important}.sd-m-0{margin:0 !important}.sd-mt-0,.sd-my-0{margin-top:0 !important}.sd-mr-0,.sd-mx-0{margin-right:0 !important}.sd-mb-0,.sd-my-0{margin-bottom:0 !important}.sd-ml-0,.sd-mx-0{margin-left:0 !important}.sd-m-1{margin:.25rem !important}.sd-mt-1,.sd-my-1{margin-top:.25rem !important}.sd-mr-1,.sd-mx-1{margin-right:.25rem !important}.sd-mb-1,.sd-my-1{margin-bottom:.25rem !important}.sd-ml-1,.sd-mx-1{margin-left:.25rem !important}.sd-m-2{margin:.5rem !important}.sd-mt-2,.sd-my-2{margin-top:.5rem !important}.sd-mr-2,.sd-mx-2{margin-right:.5rem !important}.sd-mb-2,.sd-my-2{margin-bottom:.5rem !important}.sd-ml-2,.sd-mx-2{margin-left:.5rem !important}.sd-m-3{margin:1rem !important}.sd-mt-3,.sd-my-3{margin-top:1rem !important}.sd-mr-3,.sd-mx-3{margin-right:1rem !important}.sd-mb-3,.sd-my-3{margin-bottom:1rem !important}.sd-ml-3,.sd-mx-3{margin-left:1rem !important}.sd-m-4{margin:1.5rem !important}.sd-mt-4,.sd-my-4{margin-top:1.5rem !important}.sd-mr-4,.sd-mx-4{margin-right:1.5rem !important}.sd-mb-4,.sd-my-4{margin-bottom:1.5rem !important}.sd-ml-4,.sd-mx-4{margin-left:1.5rem !important}.sd-m-5{margin:3rem !important}.sd-mt-5,.sd-my-5{margin-top:3rem !important}.sd-mr-5,.sd-mx-5{margin-right:3rem !important}.sd-mb-5,.sd-my-5{margin-bottom:3rem !important}.sd-ml-5,.sd-mx-5{margin-left:3rem !important}.sd-w-25{width:25% !important}.sd-w-50{width:50% !important}.sd-w-75{width:75% !important}.sd-w-100{width:100% !important}.sd-w-auto{width:auto !important}.sd-h-25{height:25% !important}.sd-h-50{height:50% !important}.sd-h-75{height:75% !important}.sd-h-100{height:100% !important}.sd-h-auto{height:auto !important}.sd-d-none{display:none !important}.sd-d-inline{display:inline !important}.sd-d-inline-block{display:inline-block !important}.sd-d-block{display:block !important}.sd-d-grid{display:grid !important}.sd-d-flex-row{display:-ms-flexbox !important;display:flex !important;flex-direction:row !important}.sd-d-flex-column{display:-ms-flexbox !important;display:flex !important;flex-direction:column !important}.sd-d-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}@media(min-width: 576px){.sd-d-sm-none{display:none !important}.sd-d-sm-inline{display:inline !important}.sd-d-sm-inline-block{display:inline-block !important}.sd-d-sm-block{display:block !important}.sd-d-sm-grid{display:grid !important}.sd-d-sm-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-sm-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 768px){.sd-d-md-none{display:none !important}.sd-d-md-inline{display:inline !important}.sd-d-md-inline-block{display:inline-block !important}.sd-d-md-block{display:block !important}.sd-d-md-grid{display:grid !important}.sd-d-md-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-md-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 992px){.sd-d-lg-none{display:none !important}.sd-d-lg-inline{display:inline !important}.sd-d-lg-inline-block{display:inline-block !important}.sd-d-lg-block{display:block !important}.sd-d-lg-grid{display:grid !important}.sd-d-lg-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-lg-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 1200px){.sd-d-xl-none{display:none !important}.sd-d-xl-inline{display:inline !important}.sd-d-xl-inline-block{display:inline-block !important}.sd-d-xl-block{display:block !important}.sd-d-xl-grid{display:grid !important}.sd-d-xl-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-xl-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}.sd-align-major-start{justify-content:flex-start !important}.sd-align-major-end{justify-content:flex-end !important}.sd-align-major-center{justify-content:center !important}.sd-align-major-justify{justify-content:space-between !important}.sd-align-major-spaced{justify-content:space-evenly !important}.sd-align-minor-start{align-items:flex-start !important}.sd-align-minor-end{align-items:flex-end !important}.sd-align-minor-center{align-items:center !important}.sd-align-minor-stretch{align-items:stretch !important}.sd-text-justify{text-align:justify !important}.sd-text-left{text-align:left !important}.sd-text-right{text-align:right !important}.sd-text-center{text-align:center !important}.sd-font-weight-light{font-weight:300 !important}.sd-font-weight-lighter{font-weight:lighter !important}.sd-font-weight-normal{font-weight:400 !important}.sd-font-weight-bold{font-weight:700 !important}.sd-font-weight-bolder{font-weight:bolder !important}.sd-font-italic{font-style:italic !important}.sd-text-decoration-none{text-decoration:none !important}.sd-text-lowercase{text-transform:lowercase !important}.sd-text-uppercase{text-transform:uppercase !important}.sd-text-capitalize{text-transform:capitalize !important}.sd-text-wrap{white-space:normal !important}.sd-text-nowrap{white-space:nowrap !important}.sd-text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-fs-1,.sd-fs-1>p{font-size:calc(1.375rem + 1.5vw) !important;line-height:unset !important}.sd-fs-2,.sd-fs-2>p{font-size:calc(1.325rem + 0.9vw) !important;line-height:unset !important}.sd-fs-3,.sd-fs-3>p{font-size:calc(1.3rem + 0.6vw) !important;line-height:unset !important}.sd-fs-4,.sd-fs-4>p{font-size:calc(1.275rem + 0.3vw) !important;line-height:unset !important}.sd-fs-5,.sd-fs-5>p{font-size:1.25rem !important;line-height:unset !important}.sd-fs-6,.sd-fs-6>p{font-size:1rem !important;line-height:unset !important}.sd-border-0{border:0 solid !important}.sd-border-top-0{border-top:0 solid !important}.sd-border-bottom-0{border-bottom:0 solid !important}.sd-border-right-0{border-right:0 solid !important}.sd-border-left-0{border-left:0 solid !important}.sd-border-1{border:1px solid !important}.sd-border-top-1{border-top:1px solid !important}.sd-border-bottom-1{border-bottom:1px solid !important}.sd-border-right-1{border-right:1px solid !important}.sd-border-left-1{border-left:1px solid !important}.sd-border-2{border:2px solid !important}.sd-border-top-2{border-top:2px solid !important}.sd-border-bottom-2{border-bottom:2px solid !important}.sd-border-right-2{border-right:2px solid !important}.sd-border-left-2{border-left:2px solid !important}.sd-border-3{border:3px solid !important}.sd-border-top-3{border-top:3px solid !important}.sd-border-bottom-3{border-bottom:3px solid !important}.sd-border-right-3{border-right:3px solid !important}.sd-border-left-3{border-left:3px solid !important}.sd-border-4{border:4px solid !important}.sd-border-top-4{border-top:4px solid !important}.sd-border-bottom-4{border-bottom:4px solid !important}.sd-border-right-4{border-right:4px solid !important}.sd-border-left-4{border-left:4px solid !important}.sd-border-5{border:5px solid !important}.sd-border-top-5{border-top:5px solid !important}.sd-border-bottom-5{border-bottom:5px solid !important}.sd-border-right-5{border-right:5px solid !important}.sd-border-left-5{border-left:5px solid !important}.sd-rounded-0{border-radius:0 !important}.sd-rounded-1{border-radius:.2rem !important}.sd-rounded-2{border-radius:.3rem !important}.sd-rounded-3{border-radius:.5rem !important}.sd-rounded-pill{border-radius:50rem !important}.sd-rounded-circle{border-radius:50% !important}.shadow-none{box-shadow:none !important}.sd-shadow-sm{box-shadow:0 .125rem .25rem var(--sd-color-shadow) !important}.sd-shadow-md{box-shadow:0 .5rem 1rem var(--sd-color-shadow) !important}.sd-shadow-lg{box-shadow:0 1rem 3rem var(--sd-color-shadow) !important}@keyframes sd-slide-from-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes sd-slide-from-right{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes sd-grow100{0%{transform:scale(0);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50{0%{transform:scale(0.5);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50-rot20{0%{transform:scale(0.5) rotateZ(-20deg);opacity:.5}75%{transform:scale(1) rotateZ(5deg);opacity:1}95%{transform:scale(1) rotateZ(-1deg);opacity:1}100%{transform:scale(1) rotateZ(0);opacity:1}}.sd-animate-slide-from-left{animation:1s ease-out 0s 1 normal none running sd-slide-from-left}.sd-animate-slide-from-right{animation:1s ease-out 0s 1 normal none running sd-slide-from-right}.sd-animate-grow100{animation:1s ease-out 0s 1 normal none running sd-grow100}.sd-animate-grow50{animation:1s ease-out 0s 1 normal none running sd-grow50}.sd-animate-grow50-rot20{animation:1s ease-out 0s 1 normal none running sd-grow50-rot20}.sd-badge{display:inline-block;padding:.35em .65em;font-size:.75em;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.sd-badge:empty{display:none}a.sd-badge{text-decoration:none}.sd-btn .sd-badge{position:relative;top:-1px}.sd-btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;cursor:pointer;display:inline-block;font-weight:400;font-size:1rem;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;vertical-align:middle;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.sd-btn:hover{text-decoration:none}@media(prefers-reduced-motion: reduce){.sd-btn{transition:none}}.sd-btn-primary,.sd-btn-outline-primary:hover,.sd-btn-outline-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-primary:hover,.sd-btn-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary-highlight) !important;border-color:var(--sd-color-primary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-primary{color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary,.sd-btn-outline-secondary:hover,.sd-btn-outline-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary:hover,.sd-btn-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary-highlight) !important;border-color:var(--sd-color-secondary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-secondary{color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success,.sd-btn-outline-success:hover,.sd-btn-outline-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success:hover,.sd-btn-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success-highlight) !important;border-color:var(--sd-color-success-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-success{color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info,.sd-btn-outline-info:hover,.sd-btn-outline-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info:hover,.sd-btn-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info-highlight) !important;border-color:var(--sd-color-info-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-info{color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning,.sd-btn-outline-warning:hover,.sd-btn-outline-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning:hover,.sd-btn-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning-highlight) !important;border-color:var(--sd-color-warning-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-warning{color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger,.sd-btn-outline-danger:hover,.sd-btn-outline-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger:hover,.sd-btn-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger-highlight) !important;border-color:var(--sd-color-danger-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-danger{color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light,.sd-btn-outline-light:hover,.sd-btn-outline-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light:hover,.sd-btn-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light-highlight) !important;border-color:var(--sd-color-light-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-light{color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted,.sd-btn-outline-muted:hover,.sd-btn-outline-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted:hover,.sd-btn-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted-highlight) !important;border-color:var(--sd-color-muted-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-muted{color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark,.sd-btn-outline-dark:hover,.sd-btn-outline-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark:hover,.sd-btn-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark-highlight) !important;border-color:var(--sd-color-dark-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-dark{color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black,.sd-btn-outline-black:hover,.sd-btn-outline-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black:hover,.sd-btn-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black-highlight) !important;border-color:var(--sd-color-black-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-black{color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white,.sd-btn-outline-white:hover,.sd-btn-outline-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white:hover,.sd-btn-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white-highlight) !important;border-color:var(--sd-color-white-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-white{color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.sd-hide-link-text{font-size:0}.sd-octicon,.sd-material-icon{display:inline-block;fill:currentColor;vertical-align:middle}.sd-avatar-xs{border-radius:50%;object-fit:cover;object-position:center;width:1rem;height:1rem}.sd-avatar-sm{border-radius:50%;object-fit:cover;object-position:center;width:3rem;height:3rem}.sd-avatar-md{border-radius:50%;object-fit:cover;object-position:center;width:5rem;height:5rem}.sd-avatar-lg{border-radius:50%;object-fit:cover;object-position:center;width:7rem;height:7rem}.sd-avatar-xl{border-radius:50%;object-fit:cover;object-position:center;width:10rem;height:10rem}.sd-avatar-inherit{border-radius:50%;object-fit:cover;object-position:center;width:inherit;height:inherit}.sd-avatar-initial{border-radius:50%;object-fit:cover;object-position:center;width:initial;height:initial}.sd-card{background-clip:border-box;background-color:var(--sd-color-card-background);border:1px solid var(--sd-color-card-border);border-radius:.25rem;color:var(--sd-color-card-text);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;position:relative;word-wrap:break-word}.sd-card>hr{margin-left:0;margin-right:0}.sd-card-hover:hover{border-color:var(--sd-color-card-border-hover);transform:scale(1.01)}.sd-card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem 1rem}.sd-card-title{margin-bottom:.5rem}.sd-card-subtitle{margin-top:-0.25rem;margin-bottom:0}.sd-card-text:last-child{margin-bottom:0}.sd-card-link:hover{text-decoration:none}.sd-card-link+.card-link{margin-left:1rem}.sd-card-header{padding:.5rem 1rem;margin-bottom:0;background-color:var(--sd-color-card-header);border-bottom:1px solid var(--sd-color-card-border)}.sd-card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.sd-card-footer{padding:.5rem 1rem;background-color:var(--sd-color-card-footer);border-top:1px solid var(--sd-color-card-border)}.sd-card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.sd-card-header-tabs{margin-right:-0.5rem;margin-bottom:-0.5rem;margin-left:-0.5rem;border-bottom:0}.sd-card-header-pills{margin-right:-0.5rem;margin-left:-0.5rem}.sd-card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom,.sd-card-img-top{width:100%}.sd-card-img,.sd-card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom{border-bottom-left-radius:calc(0.25rem - 1px);border-bottom-right-radius:calc(0.25rem - 1px)}.sd-cards-carousel{width:100%;display:flex;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row;overflow-x:hidden;scroll-snap-type:x mandatory}.sd-cards-carousel.sd-show-scrollbar{overflow-x:auto}.sd-cards-carousel:hover,.sd-cards-carousel:focus{overflow-x:auto}.sd-cards-carousel>.sd-card{flex-shrink:0;scroll-snap-align:start}.sd-cards-carousel>.sd-card:not(:last-child){margin-right:3px}.sd-card-cols-1>.sd-card{width:90%}.sd-card-cols-2>.sd-card{width:45%}.sd-card-cols-3>.sd-card{width:30%}.sd-card-cols-4>.sd-card{width:22.5%}.sd-card-cols-5>.sd-card{width:18%}.sd-card-cols-6>.sd-card{width:15%}.sd-card-cols-7>.sd-card{width:12.8571428571%}.sd-card-cols-8>.sd-card{width:11.25%}.sd-card-cols-9>.sd-card{width:10%}.sd-card-cols-10>.sd-card{width:9%}.sd-card-cols-11>.sd-card{width:8.1818181818%}.sd-card-cols-12>.sd-card{width:7.5%}.sd-container,.sd-container-fluid,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container-xl{margin-left:auto;margin-right:auto;padding-left:var(--sd-gutter-x, 0.75rem);padding-right:var(--sd-gutter-x, 0.75rem);width:100%}@media(min-width: 576px){.sd-container-sm,.sd-container{max-width:540px}}@media(min-width: 768px){.sd-container-md,.sd-container-sm,.sd-container{max-width:720px}}@media(min-width: 992px){.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:960px}}@media(min-width: 1200px){.sd-container-xl,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:1140px}}.sd-row{--sd-gutter-x: 1.5rem;--sd-gutter-y: 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(var(--sd-gutter-y) * -1);margin-right:calc(var(--sd-gutter-x) * -0.5);margin-left:calc(var(--sd-gutter-x) * -0.5)}.sd-row>*{box-sizing:border-box;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--sd-gutter-x) * 0.5);padding-left:calc(var(--sd-gutter-x) * 0.5);margin-top:var(--sd-gutter-y)}.sd-col{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-auto>*{flex:0 0 auto;width:auto}.sd-row-cols-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}@media(min-width: 576px){.sd-col-sm{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-sm-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-sm-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-sm-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-sm-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-sm-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-sm-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-sm-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-sm-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-sm-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-sm-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-sm-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-sm-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-sm-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 768px){.sd-col-md{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-md-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-md-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-md-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-md-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-md-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-md-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-md-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-md-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-md-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-md-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-md-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-md-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-md-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 992px){.sd-col-lg{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-lg-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-lg-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-lg-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-lg-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-lg-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-lg-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-lg-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-lg-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-lg-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-lg-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-lg-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-lg-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-lg-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 1200px){.sd-col-xl{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-xl-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-xl-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-xl-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-xl-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-xl-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-xl-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-xl-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-xl-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-xl-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-xl-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-xl-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-xl-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-xl-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}.sd-col-auto{flex:0 0 auto;-ms-flex:0 0 auto;width:auto}.sd-col-1{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}.sd-col-2{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-col-3{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-col-4{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-col-5{flex:0 0 auto;-ms-flex:0 0 auto;width:41.6666666667%}.sd-col-6{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-col-7{flex:0 0 auto;-ms-flex:0 0 auto;width:58.3333333333%}.sd-col-8{flex:0 0 auto;-ms-flex:0 0 auto;width:66.6666666667%}.sd-col-9{flex:0 0 auto;-ms-flex:0 0 auto;width:75%}.sd-col-10{flex:0 0 auto;-ms-flex:0 0 auto;width:83.3333333333%}.sd-col-11{flex:0 0 auto;-ms-flex:0 0 auto;width:91.6666666667%}.sd-col-12{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-g-0,.sd-gy-0{--sd-gutter-y: 0}.sd-g-0,.sd-gx-0{--sd-gutter-x: 0}.sd-g-1,.sd-gy-1{--sd-gutter-y: 0.25rem}.sd-g-1,.sd-gx-1{--sd-gutter-x: 0.25rem}.sd-g-2,.sd-gy-2{--sd-gutter-y: 0.5rem}.sd-g-2,.sd-gx-2{--sd-gutter-x: 0.5rem}.sd-g-3,.sd-gy-3{--sd-gutter-y: 1rem}.sd-g-3,.sd-gx-3{--sd-gutter-x: 1rem}.sd-g-4,.sd-gy-4{--sd-gutter-y: 1.5rem}.sd-g-4,.sd-gx-4{--sd-gutter-x: 1.5rem}.sd-g-5,.sd-gy-5{--sd-gutter-y: 3rem}.sd-g-5,.sd-gx-5{--sd-gutter-x: 3rem}@media(min-width: 576px){.sd-col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-sm-0,.sd-gy-sm-0{--sd-gutter-y: 0}.sd-g-sm-0,.sd-gx-sm-0{--sd-gutter-x: 0}.sd-g-sm-1,.sd-gy-sm-1{--sd-gutter-y: 0.25rem}.sd-g-sm-1,.sd-gx-sm-1{--sd-gutter-x: 0.25rem}.sd-g-sm-2,.sd-gy-sm-2{--sd-gutter-y: 0.5rem}.sd-g-sm-2,.sd-gx-sm-2{--sd-gutter-x: 0.5rem}.sd-g-sm-3,.sd-gy-sm-3{--sd-gutter-y: 1rem}.sd-g-sm-3,.sd-gx-sm-3{--sd-gutter-x: 1rem}.sd-g-sm-4,.sd-gy-sm-4{--sd-gutter-y: 1.5rem}.sd-g-sm-4,.sd-gx-sm-4{--sd-gutter-x: 1.5rem}.sd-g-sm-5,.sd-gy-sm-5{--sd-gutter-y: 3rem}.sd-g-sm-5,.sd-gx-sm-5{--sd-gutter-x: 3rem}}@media(min-width: 768px){.sd-col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-md-0,.sd-gy-md-0{--sd-gutter-y: 0}.sd-g-md-0,.sd-gx-md-0{--sd-gutter-x: 0}.sd-g-md-1,.sd-gy-md-1{--sd-gutter-y: 0.25rem}.sd-g-md-1,.sd-gx-md-1{--sd-gutter-x: 0.25rem}.sd-g-md-2,.sd-gy-md-2{--sd-gutter-y: 0.5rem}.sd-g-md-2,.sd-gx-md-2{--sd-gutter-x: 0.5rem}.sd-g-md-3,.sd-gy-md-3{--sd-gutter-y: 1rem}.sd-g-md-3,.sd-gx-md-3{--sd-gutter-x: 1rem}.sd-g-md-4,.sd-gy-md-4{--sd-gutter-y: 1.5rem}.sd-g-md-4,.sd-gx-md-4{--sd-gutter-x: 1.5rem}.sd-g-md-5,.sd-gy-md-5{--sd-gutter-y: 3rem}.sd-g-md-5,.sd-gx-md-5{--sd-gutter-x: 3rem}}@media(min-width: 992px){.sd-col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-lg-0,.sd-gy-lg-0{--sd-gutter-y: 0}.sd-g-lg-0,.sd-gx-lg-0{--sd-gutter-x: 0}.sd-g-lg-1,.sd-gy-lg-1{--sd-gutter-y: 0.25rem}.sd-g-lg-1,.sd-gx-lg-1{--sd-gutter-x: 0.25rem}.sd-g-lg-2,.sd-gy-lg-2{--sd-gutter-y: 0.5rem}.sd-g-lg-2,.sd-gx-lg-2{--sd-gutter-x: 0.5rem}.sd-g-lg-3,.sd-gy-lg-3{--sd-gutter-y: 1rem}.sd-g-lg-3,.sd-gx-lg-3{--sd-gutter-x: 1rem}.sd-g-lg-4,.sd-gy-lg-4{--sd-gutter-y: 1.5rem}.sd-g-lg-4,.sd-gx-lg-4{--sd-gutter-x: 1.5rem}.sd-g-lg-5,.sd-gy-lg-5{--sd-gutter-y: 3rem}.sd-g-lg-5,.sd-gx-lg-5{--sd-gutter-x: 3rem}}@media(min-width: 1200px){.sd-col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-xl-0,.sd-gy-xl-0{--sd-gutter-y: 0}.sd-g-xl-0,.sd-gx-xl-0{--sd-gutter-x: 0}.sd-g-xl-1,.sd-gy-xl-1{--sd-gutter-y: 0.25rem}.sd-g-xl-1,.sd-gx-xl-1{--sd-gutter-x: 0.25rem}.sd-g-xl-2,.sd-gy-xl-2{--sd-gutter-y: 0.5rem}.sd-g-xl-2,.sd-gx-xl-2{--sd-gutter-x: 0.5rem}.sd-g-xl-3,.sd-gy-xl-3{--sd-gutter-y: 1rem}.sd-g-xl-3,.sd-gx-xl-3{--sd-gutter-x: 1rem}.sd-g-xl-4,.sd-gy-xl-4{--sd-gutter-y: 1.5rem}.sd-g-xl-4,.sd-gx-xl-4{--sd-gutter-x: 1.5rem}.sd-g-xl-5,.sd-gy-xl-5{--sd-gutter-y: 3rem}.sd-g-xl-5,.sd-gx-xl-5{--sd-gutter-x: 3rem}}.sd-flex-row-reverse{flex-direction:row-reverse !important}details.sd-dropdown{position:relative}details.sd-dropdown .sd-summary-title{font-weight:700;padding-right:3em !important;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}details.sd-dropdown:hover{cursor:pointer}details.sd-dropdown .sd-summary-content{cursor:default}details.sd-dropdown summary{list-style:none;padding:1em}details.sd-dropdown summary .sd-octicon.no-title{vertical-align:middle}details.sd-dropdown[open] summary .sd-octicon.no-title{visibility:hidden}details.sd-dropdown summary::-webkit-details-marker{display:none}details.sd-dropdown summary:focus{outline:none}details.sd-dropdown .sd-summary-icon{margin-right:.5em}details.sd-dropdown .sd-summary-icon svg{opacity:.8}details.sd-dropdown summary:hover .sd-summary-up svg,details.sd-dropdown summary:hover .sd-summary-down svg{opacity:1;transform:scale(1.1)}details.sd-dropdown .sd-summary-up svg,details.sd-dropdown .sd-summary-down svg{display:block;opacity:.6}details.sd-dropdown .sd-summary-up,details.sd-dropdown .sd-summary-down{pointer-events:none;position:absolute;right:1em;top:1em}details.sd-dropdown[open]>.sd-summary-title .sd-summary-down{visibility:hidden}details.sd-dropdown:not([open])>.sd-summary-title .sd-summary-up{visibility:hidden}details.sd-dropdown:not([open]).sd-card{border:none}details.sd-dropdown:not([open])>.sd-card-header{border:1px solid var(--sd-color-card-border);border-radius:.25rem}details.sd-dropdown.sd-fade-in[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out;animation:sd-fade-in .5s ease-in-out}details.sd-dropdown.sd-fade-in-slide-down[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out}.sd-col>.sd-dropdown{width:100%}.sd-summary-content>.sd-tab-set:first-child{margin-top:0}@keyframes sd-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes sd-slide-down{0%{transform:translate(0, -10px)}100%{transform:translate(0, 0)}}.sd-tab-set{border-radius:.125rem;display:flex;flex-wrap:wrap;margin:1em 0;position:relative}.sd-tab-set>input{opacity:0;position:absolute}.sd-tab-set>input:checked+label{border-color:var(--sd-color-tabs-underline-active);color:var(--sd-color-tabs-label-active)}.sd-tab-set>input:checked+label+.sd-tab-content{display:block}.sd-tab-set>input:not(:checked)+label:hover{color:var(--sd-color-tabs-label-hover);border-color:var(--sd-color-tabs-underline-hover)}.sd-tab-set>input:focus+label{outline-style:auto}.sd-tab-set>input:not(.focus-visible)+label{outline:none;-webkit-tap-highlight-color:transparent}.sd-tab-set>label{border-bottom:.125rem solid transparent;margin-bottom:0;color:var(--sd-color-tabs-label-inactive);border-color:var(--sd-color-tabs-underline-inactive);cursor:pointer;font-size:var(--sd-fontsize-tabs-label);font-weight:700;padding:1em 1.25em .5em;transition:color 250ms;width:auto;z-index:1}html .sd-tab-set>label:hover{color:var(--sd-color-tabs-label-active)}.sd-col>.sd-tab-set{width:100%}.sd-tab-content{box-shadow:0 -0.0625rem var(--sd-color-tabs-overline),0 .0625rem var(--sd-color-tabs-underline);display:none;order:99;padding-bottom:.75rem;padding-top:.75rem;width:100%}.sd-tab-content>:first-child{margin-top:0 !important}.sd-tab-content>:last-child{margin-bottom:0 !important}.sd-tab-content>.sd-tab-set{margin:0}.sd-sphinx-override,.sd-sphinx-override *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sd-sphinx-override p{margin-top:0}:root{--sd-color-primary: #0071bc;--sd-color-secondary: #6c757d;--sd-color-success: #28a745;--sd-color-info: #17a2b8;--sd-color-warning: #f0b37e;--sd-color-danger: #dc3545;--sd-color-light: #f8f9fa;--sd-color-muted: #6c757d;--sd-color-dark: #212529;--sd-color-black: black;--sd-color-white: white;--sd-color-primary-highlight: #0060a0;--sd-color-secondary-highlight: #5c636a;--sd-color-success-highlight: #228e3b;--sd-color-info-highlight: #148a9c;--sd-color-warning-highlight: #cc986b;--sd-color-danger-highlight: #bb2d3b;--sd-color-light-highlight: #d3d4d5;--sd-color-muted-highlight: #5c636a;--sd-color-dark-highlight: #1c1f23;--sd-color-black-highlight: black;--sd-color-white-highlight: #d9d9d9;--sd-color-primary-text: #fff;--sd-color-secondary-text: #fff;--sd-color-success-text: #fff;--sd-color-info-text: #fff;--sd-color-warning-text: #212529;--sd-color-danger-text: #fff;--sd-color-light-text: #212529;--sd-color-muted-text: #fff;--sd-color-dark-text: #fff;--sd-color-black-text: #fff;--sd-color-white-text: #212529;--sd-color-shadow: rgba(0, 0, 0, 0.15);--sd-color-card-border: rgba(0, 0, 0, 0.125);--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);--sd-color-card-background: transparent;--sd-color-card-text: inherit;--sd-color-card-header: transparent;--sd-color-card-footer: transparent;--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);--sd-color-tabs-underline-inactive: transparent;--sd-color-tabs-overline: rgb(222, 222, 222);--sd-color-tabs-underline: rgb(222, 222, 222);--sd-fontsize-tabs-label: 1rem} diff --git a/review/pr-1877/_static/design-tabs.js b/review/pr-1877/_static/design-tabs.js new file mode 100644 index 00000000000..36b38cf0d91 --- /dev/null +++ b/review/pr-1877/_static/design-tabs.js @@ -0,0 +1,27 @@ +var sd_labels_by_text = {}; + +function ready() { + const li = document.getElementsByClassName("sd-tab-label"); + for (const label of li) { + syncId = label.getAttribute("data-sync-id"); + if (syncId) { + label.onclick = onLabelClick; + if (!sd_labels_by_text[syncId]) { + sd_labels_by_text[syncId] = []; + } + sd_labels_by_text[syncId].push(label); + } + } +} + +function onLabelClick() { + // Activate other inputs with the same sync id. + syncId = this.getAttribute("data-sync-id"); + for (label of sd_labels_by_text[syncId]) { + if (label === this) continue; + label.previousElementSibling.checked = true; + } + window.localStorage.setItem("sphinx-design-last-tab", syncId); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/review/pr-1877/_static/doctools.js b/review/pr-1877/_static/doctools.js new file mode 100644 index 00000000000..527b876ca63 --- /dev/null +++ b/review/pr-1877/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/review/pr-1877/_static/documentation_options.js b/review/pr-1877/_static/documentation_options.js new file mode 100644 index 00000000000..05f76e701d3 --- /dev/null +++ b/review/pr-1877/_static/documentation_options.js @@ -0,0 +1,14 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/review/pr-1877/_static/favicon.png b/review/pr-1877/_static/favicon.png new file mode 100644 index 00000000000..a00f862ecfb Binary files /dev/null and b/review/pr-1877/_static/favicon.png differ diff --git a/review/pr-1877/_static/file.png b/review/pr-1877/_static/file.png new file mode 100644 index 00000000000..a858a410e4f Binary files /dev/null and b/review/pr-1877/_static/file.png differ diff --git a/review/pr-1877/_static/images/logo_binder.svg b/review/pr-1877/_static/images/logo_binder.svg new file mode 100644 index 00000000000..45fecf75114 --- /dev/null +++ b/review/pr-1877/_static/images/logo_binder.svg @@ -0,0 +1,19 @@ + + + + +logo + + + + + + + + diff --git a/review/pr-1877/_static/images/logo_colab.png b/review/pr-1877/_static/images/logo_colab.png new file mode 100644 index 00000000000..b7560ec216b Binary files /dev/null and b/review/pr-1877/_static/images/logo_colab.png differ diff --git a/review/pr-1877/_static/images/logo_deepnote.svg b/review/pr-1877/_static/images/logo_deepnote.svg new file mode 100644 index 00000000000..fa77ebfc258 --- /dev/null +++ b/review/pr-1877/_static/images/logo_deepnote.svg @@ -0,0 +1 @@ + diff --git a/review/pr-1877/_static/images/logo_jupyterhub.svg b/review/pr-1877/_static/images/logo_jupyterhub.svg new file mode 100644 index 00000000000..60cfe9f222e --- /dev/null +++ b/review/pr-1877/_static/images/logo_jupyterhub.svg @@ -0,0 +1 @@ +logo_jupyterhubHub diff --git a/review/pr-1877/_static/jquery-3.6.0.js b/review/pr-1877/_static/jquery-3.6.0.js new file mode 100644 index 00000000000..fc6c299b73e --- /dev/null +++ b/review/pr-1877/_static/jquery-3.6.0.js @@ -0,0 +1,10881 @@ +/*! + * jQuery JavaScript Library v3.6.0 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2021-03-02T17:08Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 + // Plus for old WebKit, typeof returns "function" for HTML collections + // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) + return typeof obj === "function" && typeof obj.nodeType !== "number" && + typeof obj.item !== "function"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + +var document = window.document; + + + + var preservedScriptAttributes = { + type: true, + src: true, + nonce: true, + noModule: true + }; + + function DOMEval( code, node, doc ) { + doc = doc || document; + + var i, val, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.6.0", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + copy = options[ name ]; + + // Prevent Object.prototype pollution + // Prevent never-ending loop + if ( name === "__proto__" || target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; + + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; + } else { + clone = src; + } + copyIsArray = false; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return flat( ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), + function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); + } ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.6 + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://js.foundation/ + * + * Date: 2021-02-16 + */ +( function( window ) { +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + nonnativeSelectorCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ( {} ).hasOwnProperty, + arr = [], + pop = arr.pop, + pushNative = arr.push, + push = arr.push, + slice = arr.slice, + + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[ i ] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + + "ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + + "*" ), + rdescend = new RegExp( whitespace + "|>" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rhtml = /HTML$/i, + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + return nonHex ? + + // Strip the backslash prefix from a non-hex escape sequence + nonHex : + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + inDisabledFieldset = addCombinator( + function( elem ) { + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + ( arr = slice.call( preferredDoc.childNodes ) ), + preferredDoc.childNodes + ); + + // Support: Android<4.0 + // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + pushNative.apply( target, slice.call( els ) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + + // Can't trust NodeList.length + while ( ( target[ j++ ] = els[ i++ ] ) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + setDocument( context ); + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { + + // ID selector + if ( ( m = match[ 1 ] ) ) { + + // Document context + if ( nodeType === 9 ) { + if ( ( elem = context.getElementById( m ) ) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && ( elem = newContext.getElementById( m ) ) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[ 2 ] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && + + // Support: IE 8 only + // Exclude object elements + ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { + + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + if ( newContext !== context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); + } + newSelector = groups.join( "," ); + } + + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return ( cache[ key + " " ] = value ); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement( "fieldset" ); + + try { + return !!fn( el ); + } catch ( e ) { + return false; + } finally { + + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split( "|" ), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[ i ] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( ( cur = cur.nextSibling ) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return ( name === "input" || name === "button" ) && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + inDisabledFieldset( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction( function( argument ) { + argument = +argument; + return markFunction( function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); + } + } + } ); + } ); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + var namespace = elem && elem.namespaceURI, + docElem = elem && ( elem.ownerDocument || elem ).documentElement; + + // Support: IE <=8 + // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes + // https://bugs.jquery.com/ticket/4833 + return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9 - 11+, Edge 12 - 18+ + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, + // Safari 4 - 5 only, Opera <=11.6 - 12.x only + // IE/Edge & older browsers don't support the :scope pseudo-class. + // Support: Safari 6.0 only + // Safari 6.0 supports :scope but it's an alias of :root there. + support.scope = assert( function( el ) { + docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); + return typeof el.querySelectorAll !== "undefined" && + !el.querySelectorAll( ":scope fieldset div" ).length; + } ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert( function( el ) { + el.className = "i"; + return !el.getAttribute( "className" ); + } ); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert( function( el ) { + el.appendChild( document.createComment( "" ) ); + return !el.getElementsByTagName( "*" ).length; + } ); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert( function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + } ); + + // ID filter and find + if ( support.getById ) { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute( "id" ) === attrId; + }; + }; + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode( "id" ); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find[ "TAG" ] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { + + var input; + + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push( "~=" ); + } + + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push( ".#.+[+~]" ); + } + + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); + + assert( function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement( "input" ); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll( "[name=d]" ).length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: Opera 10 - 11 only + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll( "*,:x" ); + rbuggyQSA.push( ",.*:" ); + } ); + } + + if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector ) ) ) ) { + + assert( function( el ) { + + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + } ); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + ) ); + } : + function( a, b ) { + if ( b ) { + while ( ( b = b.parentNode ) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { + + // Choose the first element that is related to our preferred document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a == document || a.ownerDocument == preferredDoc && + contains( preferredDoc, a ) ) { + return -1; + } + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b == document || b.ownerDocument == preferredDoc && + contains( preferredDoc, b ) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + return a == document ? -1 : + b == document ? 1 : + /* eslint-enable eqeqeq */ + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( ( cur = cur.parentNode ) ) { + ap.unshift( cur ); + } + cur = b; + while ( ( cur = cur.parentNode ) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[ i ] === bp[ i ] ) { + i++; + } + + return i ? + + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[ i ], bp[ i ] ) : + + // Otherwise nodes in our document sort first + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + ap[ i ] == preferredDoc ? -1 : + bp[ i ] == preferredDoc ? 1 : + /* eslint-enable eqeqeq */ + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + setDocument( elem ); + + if ( support.matchesSelector && documentIsHTML && + !nonnativeSelectorCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + + // If no nodeType, this is expected to be an array + while ( ( node = elem[ i++ ] ) ) { + + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || + match[ 5 ] || "" ).replace( runescape, funescape ); + + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { + + // nth-* requires argument + if ( !match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); + + // other types prohibit arguments + } else if ( match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[ 6 ] && match[ 2 ]; + + if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + + // Get excess from tokenize (recursively) + ( excess = tokenize( unquoted, true ) ) && + + // advance to the next closing parenthesis + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { + + // excess is a negative index + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { + return true; + } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + ( pattern = new RegExp( "(^|" + whitespace + + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( + className, function( elem ) { + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + /* eslint-disable max-len */ + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + /* eslint-enable max-len */ + + }; + }, + + "CHILD": function( type, what, _argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, _context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( ( node = node[ dir ] ) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( ( node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + + // Use previously-cached element index if available + if ( useCache ) { + + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + + // Use the same loop as above to seek `elem` from the start + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || + ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction( function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); + } + } ) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + + // Potentially complex pseudos + "not": markFunction( function( selector ) { + + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction( function( seed, matches, _context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); + } + } + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; + matcher( input, null, xml, results ); + + // Don't keep the element (issue #299) + input[ 0 ] = null; + return !results.pop(); + }; + } ), + + "has": markFunction( function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + } ), + + "contains": markFunction( function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; + }; + } ), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + + // lang value must be a valid identifier + if ( !ridentifier.test( lang || "" ) ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( ( elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); + return false; + }; + } ), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && + ( !document.hasFocus || document.hasFocus() ) && + !!( elem.type || elem.href || ~elem.tabIndex ); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return ( nodeName === "input" && !!elem.checked ) || + ( nodeName === "option" && !!elem.selected ); + }, + + "selected": function( elem ) { + + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos[ "empty" ]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo( function() { + return [ 0 ]; + } ), + + "last": createPositionalPseudo( function( _matchIndexes, length ) { + return [ length - 1 ]; + } ), + + "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + } ), + + "even": createPositionalPseudo( function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "odd": createPositionalPseudo( function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? + argument + length : + argument > length ? + length : + argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ) + } +}; + +Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { + if ( match ) { + + // Don't consume trailing commas as valid + soFar = soFar.slice( match[ 0 ].length ) || soFar; + } + groups.push( ( tokens = [] ) ); + } + + matched = false; + + // Combinators + if ( ( match = rcombinators.exec( soFar ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + + // Cast descendant combinators to space + type: match[ 0 ].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[ i ].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || + ( outerCache[ elem.uniqueID ] = {} ); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( ( oldCache = uniqueCache[ key ] ) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return ( newCache[ 2 ] = oldCache[ 2 ] ); + } else { + + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[ i ]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[ 0 ]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[ i ], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( ( elem = unmatched[ i ] ) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction( function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( + selector || "*", + context.nodeType ? [ context ] : context, + [] + ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) ) { + + // Restore matcherIn since elem is not yet a final match + temp.push( ( matcherIn[ i ] = elem ) ); + } + } + postFinder( null, ( matcherOut = [] ), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { + + seed[ temp ] = !( results[ temp ] = elem ); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + } ); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + ( checkContext = context ).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[ j ].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens + .slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), + + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), + len = elems.length; + + if ( outermost ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + + // They will have gone through all possible matchers + if ( ( elem = !matcher && elem ) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( ( matcher = setMatchers[ j++ ] ) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[ i ] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( + selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) + ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { + + context = ( Expr.find[ "ID" ]( token.matches[ 0 ] + .replace( runescape, funescape ), context ) || [] )[ 0 ]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[ i ]; + + // Abort if we hit a combinator + if ( Expr.relative[ ( type = token.type ) ] ) { + break; + } + if ( ( find = Expr.find[ type ] ) ) { + + // Search, expanding context for leading sibling combinators + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || + context + ) ) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert( function( el ) { + + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert( function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute( "href" ) === "#"; +} ) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + } ); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert( function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +} ) ) { + addHandle( "value", function( elem, _name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + } ); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert( function( el ) { + return el.getAttribute( "disabled" ) == null; +} ) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; + } + } ); +} + +return Sizzle; + +} )( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +} +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, _i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, _i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, _i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( elem.contentDocument != null && + + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { + + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the primary Deferred + primary = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + primary.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( primary.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return primary.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); + } + + return primary.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, _key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); + } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; + }, + + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack + _default: function( event ) { + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + + // Support: Chrome 86+ + // In Chrome, if an element having a focusout handler is blurred by + // clicking outside of it, it invokes the handler synchronously. If + // that handler calls `.remove()` on the element, the data is cleared, + // leaving `result` undefined. We need to guard against this. + return result && result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + which: true +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + // Suppress native focus or blur as it's already being fired + // in leverageNative. + _default: function() { + return true; + }, + + delegateType: delegateType + }; +} ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); + events = pdataOld.events; + + if ( events ) { + dataPriv.remove( dest, "handle events" ); + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = flat( args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = isAttached( elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) + div.style.position = "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableTrDimensionsVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + // + // Support: Firefox 70+ + // Only Firefox includes border widths + // in computed dimensions. (gh-4529) + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; + tr.style.cssText = "border:1px solid"; + + // Support: Chrome 86+ + // Height set through cssText does not get applied. + // Computed height then comes back as 0. + tr.style.height = "1px"; + trChild.style.height = "9px"; + + // Support: Android 8 Chrome 86+ + // In our bodyBackground.html iframe, + // display for all div elements is set to "inline", + // which causes a problem only in Android 8 Chrome 86. + // Ensuring the div is display: block + // gets around this issue. + trChild.style.display = "block"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + + parseInt( trStyle.borderTopWidth, 10 ) + + parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; + +// Return a vendor-prefixed property or undefined +function vendorPropName( name ) { + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property +function finalPropName( name ) { + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; + } + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + + val = curCSS( elem, dimension, styles ), + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || + + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( _i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && scrollboxSizeBuggy ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && ( + jQuery.cssHooks[ tween.prop ] || + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = { guid: Date.now() }; + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml, parserErrorElem; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) {} + + parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; + if ( !xml || parserErrorElem ) { + jQuery.error( "Invalid XML: " + ( + parserErrorElem ? + jQuery.map( parserErrorElem.childNodes, function( el ) { + return el.textContent; + } ).join( "\n" ) : + data + ) ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + if ( a == null ) { + return ""; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ).filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ).map( function( _i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + +originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); + } + } + match = responseHeaders[ key.toLowerCase() + " " ]; + } + return match == null ? null : match.join( ", " ); + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Use a noop converter for missing script but not if jsonp + if ( !isSuccess && + jQuery.inArray( "script", s.dataTypes ) > -1 && + jQuery.inArray( "json", s.dataTypes ) < 0 ) { + s.converters[ "text script" ] = function() {}; + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( _i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); + + +jQuery._evalUrl = function( url, options, doc ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + + // Only evaluate the response if it is successful (gh-4126) + // dataFilter is not invoked for failure responses, so using it instead + // of the default converter is kludgy but it works. + converters: { + "text script": function() {} + }, + dataFilter: function( response ) { + jQuery.globalEval( response, options, doc ); + } + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( " +{% endmacro %} diff --git a/review/pr-1877/_static/scripts/bootstrap.js b/review/pr-1877/_static/scripts/bootstrap.js new file mode 100644 index 00000000000..bda8a602727 --- /dev/null +++ b/review/pr-1877/_static/scripts/bootstrap.js @@ -0,0 +1,3 @@ +/*! For license information please see bootstrap.js.LICENSE.txt */ +(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{afterMain:()=>w,afterRead:()=>b,afterWrite:()=>T,applyStyles:()=>D,arrow:()=>G,auto:()=>r,basePlacements:()=>a,beforeMain:()=>v,beforeRead:()=>g,beforeWrite:()=>E,bottom:()=>n,clippingParents:()=>h,computeStyles:()=>et,createPopper:()=>St,createPopperBase:()=>Lt,createPopperLite:()=>Dt,detectOverflow:()=>gt,end:()=>c,eventListeners:()=>nt,flip:()=>_t,hide:()=>yt,left:()=>o,main:()=>y,modifierPhases:()=>C,offset:()=>wt,placements:()=>m,popper:()=>u,popperGenerator:()=>kt,popperOffsets:()=>Et,preventOverflow:()=>At,read:()=>_,reference:()=>f,right:()=>s,start:()=>l,top:()=>i,variationPlacements:()=>p,viewport:()=>d,write:()=>A});var i="top",n="bottom",s="right",o="left",r="auto",a=[i,n,s,o],l="start",c="end",h="clippingParents",d="viewport",u="popper",f="reference",p=a.reduce((function(t,e){return t.concat([e+"-"+l,e+"-"+c])}),[]),m=[].concat(a,[r]).reduce((function(t,e){return t.concat([e,e+"-"+l,e+"-"+c])}),[]),g="beforeRead",_="read",b="afterRead",v="beforeMain",y="main",w="afterMain",E="beforeWrite",A="write",T="afterWrite",C=[g,_,b,v,y,w,E,A,T];function O(t){return t?(t.nodeName||"").toLowerCase():null}function x(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function k(t){return t instanceof x(t).Element||t instanceof Element}function L(t){return t instanceof x(t).HTMLElement||t instanceof HTMLElement}function S(t){return"undefined"!=typeof ShadowRoot&&(t instanceof x(t).ShadowRoot||t instanceof ShadowRoot)}const D={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];L(s)&&O(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});L(n)&&O(n)&&(Object.assign(n.style,o),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function $(t){return t.split("-")[0]}var I=Math.max,N=Math.min,P=Math.round;function M(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function j(){return!/^((?!chrome|android).)*safari/i.test(M())}function F(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&L(t)&&(s=t.offsetWidth>0&&P(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&P(n.height)/t.offsetHeight||1);var r=(k(t)?x(t):window).visualViewport,a=!j()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function H(t){var e=F(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function B(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&S(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function W(t){return x(t).getComputedStyle(t)}function z(t){return["table","td","th"].indexOf(O(t))>=0}function R(t){return((k(t)?t.ownerDocument:t.document)||window.document).documentElement}function q(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(S(t)?t.host:null)||R(t)}function V(t){return L(t)&&"fixed"!==W(t).position?t.offsetParent:null}function Y(t){for(var e=x(t),i=V(t);i&&z(i)&&"static"===W(i).position;)i=V(i);return i&&("html"===O(i)||"body"===O(i)&&"static"===W(i).position)?e:i||function(t){var e=/firefox/i.test(M());if(/Trident/i.test(M())&&L(t)&&"fixed"===W(t).position)return null;var i=q(t);for(S(i)&&(i=i.host);L(i)&&["html","body"].indexOf(O(i))<0;){var n=W(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function K(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Q(t,e,i){return I(t,N(e,i))}function X(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function U(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}const G={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,r=t.state,l=t.name,c=t.options,h=r.elements.arrow,d=r.modifiersData.popperOffsets,u=$(r.placement),f=K(u),p=[o,s].indexOf(u)>=0?"height":"width";if(h&&d){var m=function(t,e){return X("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:U(t,a))}(c.padding,r),g=H(h),_="y"===f?i:o,b="y"===f?n:s,v=r.rects.reference[p]+r.rects.reference[f]-d[f]-r.rects.popper[p],y=d[f]-r.rects.reference[f],w=Y(h),E=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,A=v/2-y/2,T=m[_],C=E-g[p]-m[b],O=E/2-g[p]/2+A,x=Q(T,O,C),k=f;r.modifiersData[l]=((e={})[k]=x,e.centerOffset=x-O,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&B(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function J(t){return t.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tt(t){var e,r=t.popper,a=t.popperRect,l=t.placement,h=t.variation,d=t.offsets,u=t.position,f=t.gpuAcceleration,p=t.adaptive,m=t.roundOffsets,g=t.isFixed,_=d.x,b=void 0===_?0:_,v=d.y,y=void 0===v?0:v,w="function"==typeof m?m({x:b,y}):{x:b,y};b=w.x,y=w.y;var E=d.hasOwnProperty("x"),A=d.hasOwnProperty("y"),T=o,C=i,O=window;if(p){var k=Y(r),L="clientHeight",S="clientWidth";k===x(r)&&"static"!==W(k=R(r)).position&&"absolute"===u&&(L="scrollHeight",S="scrollWidth"),(l===i||(l===o||l===s)&&h===c)&&(C=n,y-=(g&&k===O&&O.visualViewport?O.visualViewport.height:k[L])-a.height,y*=f?1:-1),l!==o&&(l!==i&&l!==n||h!==c)||(T=s,b-=(g&&k===O&&O.visualViewport?O.visualViewport.width:k[S])-a.width,b*=f?1:-1)}var D,$=Object.assign({position:u},p&&Z),I=!0===m?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:P(i*s)/s||0,y:P(n*s)/s||0}}({x:b,y},x(r)):{x:b,y};return b=I.x,y=I.y,f?Object.assign({},$,((D={})[C]=A?"0":"",D[T]=E?"0":"",D.transform=(O.devicePixelRatio||1)<=1?"translate("+b+"px, "+y+"px)":"translate3d("+b+"px, "+y+"px, 0)",D)):Object.assign({},$,((e={})[C]=A?y+"px":"",e[T]=E?b+"px":"",e.transform="",e))}const et={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:$(e.placement),variation:J(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,tt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,tt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var it={passive:!0};const nt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=x(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,it)})),a&&l.addEventListener("resize",i.update,it),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,it)})),a&&l.removeEventListener("resize",i.update,it)}},data:{}};var st={left:"right",right:"left",bottom:"top",top:"bottom"};function ot(t){return t.replace(/left|right|bottom|top/g,(function(t){return st[t]}))}var rt={start:"end",end:"start"};function at(t){return t.replace(/start|end/g,(function(t){return rt[t]}))}function lt(t){var e=x(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ct(t){return F(R(t)).left+lt(t).scrollLeft}function ht(t){var e=W(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function dt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:L(t)&&ht(t)?t:dt(q(t))}function ut(t,e){var i;void 0===e&&(e=[]);var n=dt(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=x(n),r=s?[o].concat(o.visualViewport||[],ht(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(ut(q(r)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function pt(t,e,i){return e===d?ft(function(t,e){var i=x(t),n=R(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=j();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+ct(t),y:l}}(t,i)):k(e)?function(t,e){var i=F(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):ft(function(t){var e,i=R(t),n=lt(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=I(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=I(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+ct(t),l=-n.scrollTop;return"rtl"===W(s||i).direction&&(a+=I(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(R(t)))}function mt(t){var e,r=t.reference,a=t.element,h=t.placement,d=h?$(h):null,u=h?J(h):null,f=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2;switch(d){case i:e={x:f,y:r.y-a.height};break;case n:e={x:f,y:r.y+r.height};break;case s:e={x:r.x+r.width,y:p};break;case o:e={x:r.x-a.width,y:p};break;default:e={x:r.x,y:r.y}}var m=d?K(d):null;if(null!=m){var g="y"===m?"height":"width";switch(u){case l:e[m]=e[m]-(r[g]/2-a[g]/2);break;case c:e[m]=e[m]+(r[g]/2-a[g]/2)}}return e}function gt(t,e){void 0===e&&(e={});var o=e,r=o.placement,l=void 0===r?t.placement:r,c=o.strategy,p=void 0===c?t.strategy:c,m=o.boundary,g=void 0===m?h:m,_=o.rootBoundary,b=void 0===_?d:_,v=o.elementContext,y=void 0===v?u:v,w=o.altBoundary,E=void 0!==w&&w,A=o.padding,T=void 0===A?0:A,C=X("number"!=typeof T?T:U(T,a)),x=y===u?f:u,S=t.rects.popper,D=t.elements[E?x:y],$=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=ut(q(t)),i=["absolute","fixed"].indexOf(W(t).position)>=0&&L(t)?Y(t):t;return k(i)?e.filter((function(t){return k(t)&&B(t,i)&&"body"!==O(t)})):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce((function(e,i){var s=pt(t,i,n);return e.top=I(s.top,e.top),e.right=N(s.right,e.right),e.bottom=N(s.bottom,e.bottom),e.left=I(s.left,e.left),e}),pt(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(k(D)?D:D.contextElement||R(t.elements.popper),g,b,p),P=F(t.elements.reference),M=mt({reference:P,element:S,strategy:"absolute",placement:l}),j=ft(Object.assign({},S,M)),H=y===u?j:P,z={top:$.top-H.top+C.top,bottom:H.bottom-$.bottom+C.bottom,left:$.left-H.left+C.left,right:H.right-$.right+C.right},V=t.modifiersData.offset;if(y===u&&V){var K=V[l];Object.keys(z).forEach((function(t){var e=[s,n].indexOf(t)>=0?1:-1,o=[i,n].indexOf(t)>=0?"y":"x";z[t]+=K[o]*e}))}return z}const _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,c=t.options,h=t.name;if(!e.modifiersData[h]._skip){for(var d=c.mainAxis,u=void 0===d||d,f=c.altAxis,g=void 0===f||f,_=c.fallbackPlacements,b=c.padding,v=c.boundary,y=c.rootBoundary,w=c.altBoundary,E=c.flipVariations,A=void 0===E||E,T=c.allowedAutoPlacements,C=e.options.placement,O=$(C),x=_||(O!==C&&A?function(t){if($(t)===r)return[];var e=ot(t);return[at(t),e,at(e)]}(C):[ot(C)]),k=[C].concat(x).reduce((function(t,i){return t.concat($(i)===r?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,l=i.flipVariations,c=i.allowedAutoPlacements,h=void 0===c?m:c,d=J(n),u=d?l?p:p.filter((function(t){return J(t)===d})):a,f=u.filter((function(t){return h.indexOf(t)>=0}));0===f.length&&(f=u);var g=f.reduce((function(e,i){return e[i]=gt(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[$(i)],e}),{});return Object.keys(g).sort((function(t,e){return g[t]-g[e]}))}(e,{placement:i,boundary:v,rootBoundary:y,padding:b,flipVariations:A,allowedAutoPlacements:T}):i)}),[]),L=e.rects.reference,S=e.rects.popper,D=new Map,I=!0,N=k[0],P=0;P=0,B=H?"width":"height",W=gt(e,{placement:M,boundary:v,rootBoundary:y,altBoundary:w,padding:b}),z=H?F?s:o:F?n:i;L[B]>S[B]&&(z=ot(z));var R=ot(z),q=[];if(u&&q.push(W[j]<=0),g&&q.push(W[z]<=0,W[R]<=0),q.every((function(t){return t}))){N=M,I=!1;break}D.set(M,q)}if(I)for(var V=function(t){var e=k.find((function(e){var i=D.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return N=e,"break"},Y=A?3:1;Y>0&&"break"!==V(Y);Y--);e.placement!==N&&(e.modifiersData[h]._skip=!0,e.placement=N,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function bt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function vt(t){return[i,s,n,o].some((function(e){return t[e]>=0}))}const yt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=gt(e,{elementContext:"reference"}),a=gt(e,{altBoundary:!0}),l=bt(r,n),c=bt(a,s,o),h=vt(l),d=vt(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},wt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,r=t.name,a=n.offset,l=void 0===a?[0,0]:a,c=m.reduce((function(t,n){return t[n]=function(t,e,n){var r=$(t),a=[o,i].indexOf(r)>=0?-1:1,l="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=l[0],h=l[1];return c=c||0,h=(h||0)*a,[o,s].indexOf(r)>=0?{x:h,y:c}:{x:c,y:h}}(n,e.rects,l),t}),{}),h=c[e.placement],d=h.x,u=h.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=c}},Et={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=mt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},At={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,a=t.name,c=r.mainAxis,h=void 0===c||c,d=r.altAxis,u=void 0!==d&&d,f=r.boundary,p=r.rootBoundary,m=r.altBoundary,g=r.padding,_=r.tether,b=void 0===_||_,v=r.tetherOffset,y=void 0===v?0:v,w=gt(e,{boundary:f,rootBoundary:p,padding:g,altBoundary:m}),E=$(e.placement),A=J(e.placement),T=!A,C=K(E),O="x"===C?"y":"x",x=e.modifiersData.popperOffsets,k=e.rects.reference,L=e.rects.popper,S="function"==typeof y?y(Object.assign({},e.rects,{placement:e.placement})):y,D="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(x){if(h){var j,F="y"===C?i:o,B="y"===C?n:s,W="y"===C?"height":"width",z=x[C],R=z+w[F],q=z-w[B],V=b?-L[W]/2:0,X=A===l?k[W]:L[W],U=A===l?-L[W]:-k[W],G=e.elements.arrow,Z=b&&G?H(G):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[F],it=tt[B],nt=Q(0,k[W],Z[W]),st=T?k[W]/2-V-nt-et-D.mainAxis:X-nt-et-D.mainAxis,ot=T?-k[W]/2+V+nt+it+D.mainAxis:U+nt+it+D.mainAxis,rt=e.elements.arrow&&Y(e.elements.arrow),at=rt?"y"===C?rt.clientTop||0:rt.clientLeft||0:0,lt=null!=(j=null==P?void 0:P[C])?j:0,ct=z+ot-lt,ht=Q(b?N(R,z+st-lt-at):R,z,b?I(q,ct):q);x[C]=ht,M[C]=ht-z}if(u){var dt,ut="x"===C?i:o,ft="x"===C?n:s,pt=x[O],mt="y"===O?"height":"width",_t=pt+w[ut],bt=pt-w[ft],vt=-1!==[i,o].indexOf(E),yt=null!=(dt=null==P?void 0:P[O])?dt:0,wt=vt?_t:pt-k[mt]-L[mt]-yt+D.altAxis,Et=vt?pt+k[mt]+L[mt]-yt-D.altAxis:bt,At=b&&vt?function(t,e,i){var n=Q(t,e,i);return n>i?i:n}(wt,pt,Et):Q(b?wt:_t,pt,b?Et:bt);x[O]=At,M[O]=At-pt}e.modifiersData[a]=M}},requiresIfExists:["offset"]};function Tt(t,e,i){void 0===i&&(i=!1);var n,s,o=L(e),r=L(e)&&function(t){var e=t.getBoundingClientRect(),i=P(e.width)/t.offsetWidth||1,n=P(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=R(e),l=F(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==O(e)||ht(a))&&(c=(n=e)!==x(n)&&L(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:lt(n)),L(e)?((h=F(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=ct(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Ct(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function xt(){for(var t=arguments.length,e=new Array(t),i=0;i$t.has(t)&&$t.get(t).get(e)||null,remove(t,e){if(!$t.has(t))return;const i=$t.get(t);i.delete(e),0===i.size&&$t.delete(t)}},Nt="transitionend",Pt=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),Mt=t=>{t.dispatchEvent(new Event(Nt))},jt=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),Ft=t=>jt(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(Pt(t)):null,Ht=t=>{if(!jt(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},Bt=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),Wt=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?Wt(t.parentNode):null},zt=()=>{},Rt=t=>{t.offsetHeight},qt=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Vt=[],Yt=()=>"rtl"===document.documentElement.dir,Kt=t=>{var e;e=()=>{const e=qt();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(Vt.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of Vt)t()})),Vt.push(e)):e()},Qt=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,Xt=(t,e,i=!0)=>{if(!i)return void Qt(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let s=!1;const o=({target:i})=>{i===e&&(s=!0,e.removeEventListener(Nt,o),Qt(t))};e.addEventListener(Nt,o),setTimeout((()=>{s||Mt(e)}),n)},Ut=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},Gt=/[^.]*(?=\..*)\.|.*/,Jt=/\..*/,Zt=/::\d+$/,te={};let ee=1;const ie={mouseenter:"mouseover",mouseleave:"mouseout"},ne=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function se(t,e){return e&&`${e}::${ee++}`||t.uidEvent||ee++}function oe(t){const e=se(t);return t.uidEvent=e,te[e]=te[e]||{},te[e]}function re(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function ae(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=de(t);return ne.has(o)||(o=t),[n,s,o]}function le(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=ae(e,i,n);if(e in ie){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=oe(t),c=l[a]||(l[a]={}),h=re(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=se(r,e.replace(Gt,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return fe(s,{delegateTarget:r}),n.oneOff&&ue.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return fe(n,{delegateTarget:t}),i.oneOff&&ue.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function ce(t,e,i,n,s){const o=re(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function he(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&ce(t,e,i,r.callable,r.delegationSelector)}function de(t){return t=t.replace(Jt,""),ie[t]||t}const ue={on(t,e,i,n){le(t,e,i,n,!1)},one(t,e,i,n){le(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=ae(e,i,n),a=r!==e,l=oe(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))he(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(Zt,"");a&&!e.includes(s)||ce(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;ce(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=qt();let s=null,o=!0,r=!0,a=!1;e!==de(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=fe(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function fe(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function pe(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function me(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const ge={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${me(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${me(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=pe(t.dataset[n])}return e},getDataAttribute:(t,e)=>pe(t.getAttribute(`data-bs-${me(e)}`))};class _e{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=jt(e)?ge.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...jt(e)?ge.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[n,s]of Object.entries(e)){const e=t[n],o=jt(e)?"element":null==(i=e)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${o}" but expected type "${s}".`)}var i}}class be extends _e{constructor(t,e){super(),(t=Ft(t))&&(this._element=t,this._config=this._getConfig(e),It.set(this._element,this.constructor.DATA_KEY,this))}dispose(){It.remove(this._element,this.constructor.DATA_KEY),ue.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){Xt(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return It.get(Ft(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.2"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const ve=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?Pt(i.trim()):null}return e},ye={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!Bt(t)&&Ht(t)))},getSelectorFromElement(t){const e=ve(t);return e&&ye.findOne(e)?e:null},getElementFromSelector(t){const e=ve(t);return e?ye.findOne(e):null},getMultipleElementsFromSelector(t){const e=ve(t);return e?ye.find(e):[]}},we=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;ue.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),Bt(this))return;const s=ye.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()}))},Ee=".bs.alert",Ae=`close${Ee}`,Te=`closed${Ee}`;class Ce extends be{static get NAME(){return"alert"}close(){if(ue.trigger(this._element,Ae).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),ue.trigger(this._element,Te),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=Ce.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}we(Ce,"close"),Kt(Ce);const Oe='[data-bs-toggle="button"]';class xe extends be{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=xe.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}ue.on(document,"click.bs.button.data-api",Oe,(t=>{t.preventDefault();const e=t.target.closest(Oe);xe.getOrCreateInstance(e).toggle()})),Kt(xe);const ke=".bs.swipe",Le=`touchstart${ke}`,Se=`touchmove${ke}`,De=`touchend${ke}`,$e=`pointerdown${ke}`,Ie=`pointerup${ke}`,Ne={endCallback:null,leftCallback:null,rightCallback:null},Pe={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Me extends _e{constructor(t,e){super(),this._element=t,t&&Me.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Ne}static get DefaultType(){return Pe}static get NAME(){return"swipe"}dispose(){ue.off(this._element,ke)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),Qt(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&Qt(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(ue.on(this._element,$e,(t=>this._start(t))),ue.on(this._element,Ie,(t=>this._end(t))),this._element.classList.add("pointer-event")):(ue.on(this._element,Le,(t=>this._start(t))),ue.on(this._element,Se,(t=>this._move(t))),ue.on(this._element,De,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const je=".bs.carousel",Fe=".data-api",He="next",Be="prev",We="left",ze="right",Re=`slide${je}`,qe=`slid${je}`,Ve=`keydown${je}`,Ye=`mouseenter${je}`,Ke=`mouseleave${je}`,Qe=`dragstart${je}`,Xe=`load${je}${Fe}`,Ue=`click${je}${Fe}`,Ge="carousel",Je="active",Ze=".active",ti=".carousel-item",ei=Ze+ti,ii={ArrowLeft:ze,ArrowRight:We},ni={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},si={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class oi extends be{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ye.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===Ge&&this.cycle()}static get Default(){return ni}static get DefaultType(){return si}static get NAME(){return"carousel"}next(){this._slide(He)}nextWhenVisible(){!document.hidden&&Ht(this._element)&&this.next()}prev(){this._slide(Be)}pause(){this._isSliding&&Mt(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?ue.one(this._element,qe,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void ue.one(this._element,qe,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?He:Be;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&ue.on(this._element,Ve,(t=>this._keydown(t))),"hover"===this._config.pause&&(ue.on(this._element,Ye,(()=>this.pause())),ue.on(this._element,Ke,(()=>this._maybeEnableCycle()))),this._config.touch&&Me.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of ye.find(".carousel-item img",this._element))ue.on(t,Qe,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(We)),rightCallback:()=>this._slide(this._directionToOrder(ze)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new Me(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=ii[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=ye.findOne(Ze,this._indicatorsElement);e.classList.remove(Je),e.removeAttribute("aria-current");const i=ye.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(Je),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===He,s=e||Ut(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>ue.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(Re).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),Rt(s),i.classList.add(l),s.classList.add(l),this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(Je),i.classList.remove(Je,c,l),this._isSliding=!1,r(qe)}),i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return ye.findOne(ei,this._element)}_getItems(){return ye.find(ti,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return Yt()?t===We?Be:He:t===We?He:Be}_orderToDirection(t){return Yt()?t===Be?We:ze:t===Be?ze:We}static jQueryInterface(t){return this.each((function(){const e=oi.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}ue.on(document,Ue,"[data-bs-slide], [data-bs-slide-to]",(function(t){const e=ye.getElementFromSelector(this);if(!e||!e.classList.contains(Ge))return;t.preventDefault();const i=oi.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===ge.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),ue.on(window,Xe,(()=>{const t=ye.find('[data-bs-ride="carousel"]');for(const e of t)oi.getOrCreateInstance(e)})),Kt(oi);const ri=".bs.collapse",ai=`show${ri}`,li=`shown${ri}`,ci=`hide${ri}`,hi=`hidden${ri}`,di=`click${ri}.data-api`,ui="show",fi="collapse",pi="collapsing",mi=`:scope .${fi} .${fi}`,gi='[data-bs-toggle="collapse"]',_i={parent:null,toggle:!0},bi={parent:"(null|element)",toggle:"boolean"};class vi extends be{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=ye.find(gi);for(const t of i){const e=ye.getSelectorFromElement(t),i=ye.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return _i}static get DefaultType(){return bi}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>vi.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(ue.trigger(this._element,ai).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(fi),this._element.classList.add(pi),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(pi),this._element.classList.add(fi,ui),this._element.style[e]="",ue.trigger(this._element,li)}),this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(ue.trigger(this._element,ci).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,Rt(this._element),this._element.classList.add(pi),this._element.classList.remove(fi,ui);for(const t of this._triggerArray){const e=ye.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(pi),this._element.classList.add(fi),ue.trigger(this._element,hi)}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(ui)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=Ft(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(gi);for(const e of t){const t=ye.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=ye.find(mi,this._config.parent);return ye.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=vi.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}ue.on(document,di,gi,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of ye.getMultipleElementsFromSelector(this))vi.getOrCreateInstance(t,{toggle:!1}).toggle()})),Kt(vi);const yi="dropdown",wi=".bs.dropdown",Ei=".data-api",Ai="ArrowUp",Ti="ArrowDown",Ci=`hide${wi}`,Oi=`hidden${wi}`,xi=`show${wi}`,ki=`shown${wi}`,Li=`click${wi}${Ei}`,Si=`keydown${wi}${Ei}`,Di=`keyup${wi}${Ei}`,$i="show",Ii='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Ni=`${Ii}.${$i}`,Pi=".dropdown-menu",Mi=Yt()?"top-end":"top-start",ji=Yt()?"top-start":"top-end",Fi=Yt()?"bottom-end":"bottom-start",Hi=Yt()?"bottom-start":"bottom-end",Bi=Yt()?"left-start":"right-start",Wi=Yt()?"right-start":"left-start",zi={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Ri={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class qi extends be{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=ye.next(this._element,Pi)[0]||ye.prev(this._element,Pi)[0]||ye.findOne(Pi,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return zi}static get DefaultType(){return Ri}static get NAME(){return yi}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Bt(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!ue.trigger(this._element,xi,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))ue.on(t,"mouseover",zt);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add($i),this._element.classList.add($i),ue.trigger(this._element,ki,t)}}hide(){if(Bt(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!ue.trigger(this._element,Ci,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))ue.off(t,"mouseover",zt);this._popper&&this._popper.destroy(),this._menu.classList.remove($i),this._element.classList.remove($i),this._element.setAttribute("aria-expanded","false"),ge.removeDataAttribute(this._menu,"popper"),ue.trigger(this._element,Oi,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!jt(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${yi.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===e)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:jt(this._config.reference)?t=Ft(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const i=this._getPopperConfig();this._popper=St(t,this._menu,i)}_isShown(){return this._menu.classList.contains($i)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return Bi;if(t.classList.contains("dropstart"))return Wi;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?ji:Mi:e?Hi:Fi}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(ge.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...Qt(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const i=ye.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>Ht(t)));i.length&&Ut(i,e,t===Ti,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=qi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=ye.find(Ni);for(const i of e){const e=qi.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Ai,Ti].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(Ii)?this:ye.prev(this,Ii)[0]||ye.next(this,Ii)[0]||ye.findOne(Ii,t.delegateTarget.parentNode),o=qi.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}ue.on(document,Si,Ii,qi.dataApiKeydownHandler),ue.on(document,Si,Pi,qi.dataApiKeydownHandler),ue.on(document,Li,qi.clearMenus),ue.on(document,Di,qi.clearMenus),ue.on(document,Li,Ii,(function(t){t.preventDefault(),qi.getOrCreateInstance(this).toggle()})),Kt(qi);const Vi="backdrop",Yi="show",Ki=`mousedown.bs.${Vi}`,Qi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Xi={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Ui extends _e{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Qi}static get DefaultType(){return Xi}static get NAME(){return Vi}show(t){if(!this._config.isVisible)return void Qt(t);this._append();const e=this._getElement();this._config.isAnimated&&Rt(e),e.classList.add(Yi),this._emulateAnimation((()=>{Qt(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Yi),this._emulateAnimation((()=>{this.dispose(),Qt(t)}))):Qt(t)}dispose(){this._isAppended&&(ue.off(this._element,Ki),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Ft(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),ue.on(t,Ki,(()=>{Qt(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){Xt(t,this._getElement(),this._config.isAnimated)}}const Gi=".bs.focustrap",Ji=`focusin${Gi}`,Zi=`keydown.tab${Gi}`,tn="backward",en={autofocus:!0,trapElement:null},nn={autofocus:"boolean",trapElement:"element"};class sn extends _e{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return en}static get DefaultType(){return nn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),ue.off(document,Gi),ue.on(document,Ji,(t=>this._handleFocusin(t))),ue.on(document,Zi,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,ue.off(document,Gi))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=ye.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===tn?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?tn:"forward")}}const on=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",rn=".sticky-top",an="padding-right",ln="margin-right";class cn{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,an,(e=>e+t)),this._setElementAttributes(on,an,(e=>e+t)),this._setElementAttributes(rn,ln,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,an),this._resetElementAttributes(on,an),this._resetElementAttributes(rn,ln)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&ge.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=ge.getDataAttribute(t,e);null!==i?(ge.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(jt(t))e(t);else for(const i of ye.find(t,this._element))e(i)}}const hn=".bs.modal",dn=`hide${hn}`,un=`hidePrevented${hn}`,fn=`hidden${hn}`,pn=`show${hn}`,mn=`shown${hn}`,gn=`resize${hn}`,_n=`click.dismiss${hn}`,bn=`mousedown.dismiss${hn}`,vn=`keydown.dismiss${hn}`,yn=`click${hn}.data-api`,wn="modal-open",En="show",An="modal-static",Tn={backdrop:!0,focus:!0,keyboard:!0},Cn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class On extends be{constructor(t,e){super(t,e),this._dialog=ye.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new cn,this._addEventListeners()}static get Default(){return Tn}static get DefaultType(){return Cn}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||ue.trigger(this._element,pn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(wn),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(ue.trigger(this._element,dn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(En),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){ue.off(window,hn),ue.off(this._dialog,hn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ui({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=ye.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),Rt(this._element),this._element.classList.add(En),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,ue.trigger(this._element,mn,{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){ue.on(this._element,vn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),ue.on(window,gn,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),ue.on(this._element,bn,(t=>{ue.one(this._element,_n,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(wn),this._resetAdjustments(),this._scrollBar.reset(),ue.trigger(this._element,fn)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(ue.trigger(this._element,un).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(An)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(An),this._queueCallback((()=>{this._element.classList.remove(An),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=Yt()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=Yt()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=On.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}ue.on(document,yn,'[data-bs-toggle="modal"]',(function(t){const e=ye.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),ue.one(e,pn,(t=>{t.defaultPrevented||ue.one(e,fn,(()=>{Ht(this)&&this.focus()}))}));const i=ye.findOne(".modal.show");i&&On.getInstance(i).hide(),On.getOrCreateInstance(e).toggle(this)})),we(On),Kt(On);const xn=".bs.offcanvas",kn=".data-api",Ln=`load${xn}${kn}`,Sn="show",Dn="showing",$n="hiding",In=".offcanvas.show",Nn=`show${xn}`,Pn=`shown${xn}`,Mn=`hide${xn}`,jn=`hidePrevented${xn}`,Fn=`hidden${xn}`,Hn=`resize${xn}`,Bn=`click${xn}${kn}`,Wn=`keydown.dismiss${xn}`,zn={backdrop:!0,keyboard:!0,scroll:!1},Rn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class qn extends be{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return zn}static get DefaultType(){return Rn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||ue.trigger(this._element,Nn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new cn).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Dn),this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Sn),this._element.classList.remove(Dn),ue.trigger(this._element,Pn,{relatedTarget:t})}),this._element,!0))}hide(){this._isShown&&(ue.trigger(this._element,Mn).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add($n),this._backdrop.hide(),this._queueCallback((()=>{this._element.classList.remove(Sn,$n),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new cn).reset(),ue.trigger(this._element,Fn)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Ui({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():ue.trigger(this._element,jn)}:null})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_addEventListeners(){ue.on(this._element,Wn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():ue.trigger(this._element,jn))}))}static jQueryInterface(t){return this.each((function(){const e=qn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}ue.on(document,Bn,'[data-bs-toggle="offcanvas"]',(function(t){const e=ye.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),Bt(this))return;ue.one(e,Fn,(()=>{Ht(this)&&this.focus()}));const i=ye.findOne(In);i&&i!==e&&qn.getInstance(i).hide(),qn.getOrCreateInstance(e).toggle(this)})),ue.on(window,Ln,(()=>{for(const t of ye.find(In))qn.getOrCreateInstance(t).show()})),ue.on(window,Hn,(()=>{for(const t of ye.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&qn.getOrCreateInstance(t).hide()})),we(qn),Kt(qn);const Vn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Yn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Kn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Qn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Yn.has(i)||Boolean(Kn.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))},Xn={allowList:Vn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Un={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Gn={entry:"(string|element|function|null)",selector:"(string|element)"};class Jn extends _e{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Xn}static get DefaultType(){return Un}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Gn)}_setContent(t,e,i){const n=ye.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?jt(e)?this._putElementInTemplate(Ft(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Qn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Qt(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Zn=new Set(["sanitize","allowList","sanitizeFn"]),ts="fade",es="show",is=".modal",ns="hide.bs.modal",ss="hover",os="focus",rs={AUTO:"auto",TOP:"top",RIGHT:Yt()?"left":"right",BOTTOM:"bottom",LEFT:Yt()?"right":"left"},as={allowList:Vn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},ls={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class cs extends be{constructor(t,i){if(void 0===e)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,i),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return as}static get DefaultType(){return ls}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),ue.off(this._element.closest(is),ns,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=ue.trigger(this._element,this.constructor.eventName("show")),e=(Wt(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),ue.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))ue.on(t,"mouseover",zt);this._queueCallback((()=>{ue.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(this._isShown()&&!ue.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))ue.off(t,"mouseover",zt);this._activeTrigger.click=!1,this._activeTrigger[os]=!1,this._activeTrigger[ss]=!1,this._isHovered=null,this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),ue.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(ts,es),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(ts),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Jn({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ts)}_isShown(){return this.tip&&this.tip.classList.contains(es)}_createPopper(t){const e=Qt(this._config.placement,[this,t,this._element]),i=rs[e.toUpperCase()];return St(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return Qt(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...Qt(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)ue.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===ss?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===ss?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");ue.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?os:ss]=!0,e._enter()})),ue.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?os:ss]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},ue.on(this._element.closest(is),ns,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=ge.getDataAttributes(this._element);for(const t of Object.keys(e))Zn.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:Ft(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=cs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Kt(cs);const hs={...cs.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},ds={...cs.DefaultType,content:"(null|string|element|function)"};class us extends cs{static get Default(){return hs}static get DefaultType(){return ds}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=us.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Kt(us);const fs=".bs.scrollspy",ps=`activate${fs}`,ms=`click${fs}`,gs=`load${fs}.data-api`,_s="active",bs="[href]",vs=".nav-link",ys=`${vs}, .nav-item > ${vs}, .list-group-item`,ws={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Es={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class As extends be{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ws}static get DefaultType(){return Es}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Ft(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(ue.off(this._config.target,ms),ue.on(this._config.target,ms,bs,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=ye.find(bs,this._config.target);for(const e of t){if(!e.hash||Bt(e))continue;const t=ye.findOne(decodeURI(e.hash),this._element);Ht(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(_s),this._activateParents(t),ue.trigger(this._element,ps,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))ye.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(_s);else for(const e of ye.parents(t,".nav, .list-group"))for(const t of ye.prev(e,ys))t.classList.add(_s)}_clearActiveClass(t){t.classList.remove(_s);const e=ye.find(`${bs}.${_s}`,t);for(const t of e)t.classList.remove(_s)}static jQueryInterface(t){return this.each((function(){const e=As.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}ue.on(window,gs,(()=>{for(const t of ye.find('[data-bs-spy="scroll"]'))As.getOrCreateInstance(t)})),Kt(As);const Ts=".bs.tab",Cs=`hide${Ts}`,Os=`hidden${Ts}`,xs=`show${Ts}`,ks=`shown${Ts}`,Ls=`click${Ts}`,Ss=`keydown${Ts}`,Ds=`load${Ts}`,$s="ArrowLeft",Is="ArrowRight",Ns="ArrowUp",Ps="ArrowDown",Ms="Home",js="End",Fs="active",Hs="fade",Bs="show",Ws=".dropdown-toggle",zs=`:not(${Ws})`,Rs='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',qs=`.nav-link${zs}, .list-group-item${zs}, [role="tab"]${zs}, ${Rs}`,Vs=`.${Fs}[data-bs-toggle="tab"], .${Fs}[data-bs-toggle="pill"], .${Fs}[data-bs-toggle="list"]`;class Ys extends be{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),ue.on(this._element,Ss,(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?ue.trigger(e,Cs,{relatedTarget:t}):null;ue.trigger(t,xs,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(Fs),this._activate(ye.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),ue.trigger(t,ks,{relatedTarget:e})):t.classList.add(Bs)}),t,t.classList.contains(Hs)))}_deactivate(t,e){t&&(t.classList.remove(Fs),t.blur(),this._deactivate(ye.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),ue.trigger(t,Os,{relatedTarget:e})):t.classList.remove(Bs)}),t,t.classList.contains(Hs)))}_keydown(t){if(![$s,Is,Ns,Ps,Ms,js].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!Bt(t)));let i;if([Ms,js].includes(t.key))i=e[t.key===Ms?0:e.length-1];else{const n=[Is,Ps].includes(t.key);i=Ut(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),Ys.getOrCreateInstance(i).show())}_getChildren(){return ye.find(qs,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=ye.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=ye.findOne(t,i);s&&s.classList.toggle(n,e)};n(Ws,Fs),n(".dropdown-menu",Bs),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(Fs)}_getInnerElement(t){return t.matches(qs)?t:ye.findOne(qs,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=Ys.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}ue.on(document,Ls,Rs,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),Bt(this)||Ys.getOrCreateInstance(this).show()})),ue.on(window,Ds,(()=>{for(const t of ye.find(Vs))Ys.getOrCreateInstance(t)})),Kt(Ys);const Ks=".bs.toast",Qs=`mouseover${Ks}`,Xs=`mouseout${Ks}`,Us=`focusin${Ks}`,Gs=`focusout${Ks}`,Js=`hide${Ks}`,Zs=`hidden${Ks}`,to=`show${Ks}`,eo=`shown${Ks}`,io="hide",no="show",so="showing",oo={animation:"boolean",autohide:"boolean",delay:"number"},ro={animation:!0,autohide:!0,delay:5e3};class ao extends be{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return ro}static get DefaultType(){return oo}static get NAME(){return"toast"}show(){ue.trigger(this._element,to).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(io),Rt(this._element),this._element.classList.add(no,so),this._queueCallback((()=>{this._element.classList.remove(so),ue.trigger(this._element,eo),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this.isShown()&&(ue.trigger(this._element,Js).defaultPrevented||(this._element.classList.add(so),this._queueCallback((()=>{this._element.classList.add(io),this._element.classList.remove(so,no),ue.trigger(this._element,Zs)}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(no),super.dispose()}isShown(){return this._element.classList.contains(no)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){ue.on(this._element,Qs,(t=>this._onInteraction(t,!0))),ue.on(this._element,Xs,(t=>this._onInteraction(t,!1))),ue.on(this._element,Us,(t=>this._onInteraction(t,!0))),ue.on(this._element,Gs,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=ao.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}function lo(t){"loading"!=document.readyState?t():document.addEventListener("DOMContentLoaded",t)}we(ao),Kt(ao),lo((function(){[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(t){return new cs(t,{delay:{show:500,hide:100}})}))})),lo((function(){document.getElementById("pst-back-to-top").addEventListener("click",(function(){document.body.scrollTop=0,document.documentElement.scrollTop=0}))})),lo((function(){var t=document.getElementById("pst-back-to-top"),e=document.getElementsByClassName("bd-header")[0].getBoundingClientRect();window.addEventListener("scroll",(function(){this.oldScroll>this.scrollY&&this.scrollY>e.bottom?t.style.display="block":t.style.display="none",this.oldScroll=this.scrollY}))}))})(); +//# sourceMappingURL=bootstrap.js.map \ No newline at end of file diff --git a/review/pr-1877/_static/scripts/bootstrap.js.LICENSE.txt b/review/pr-1877/_static/scripts/bootstrap.js.LICENSE.txt new file mode 100644 index 00000000000..10f979d078a --- /dev/null +++ b/review/pr-1877/_static/scripts/bootstrap.js.LICENSE.txt @@ -0,0 +1,5 @@ +/*! + * Bootstrap v5.3.2 (https://getbootstrap.com/) + * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ diff --git a/review/pr-1877/_static/scripts/bootstrap.js.map b/review/pr-1877/_static/scripts/bootstrap.js.map new file mode 100644 index 00000000000..e5bc15752dd --- /dev/null +++ b/review/pr-1877/_static/scripts/bootstrap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/bootstrap.js","mappings":";mBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,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B,GAAmButB,IEtyInBQ,IAvCA,WAC2B,GAAG93B,MAAM5U,KAChC6H,SAAS+a,iBAAiB,+BAETtd,KAAI,SAAUqnC,GAC/B,OAAO,IAAI/J,GAAQ+J,EAAkB,CAAElK,MAAO,CAAEvQ,KAAM,IAAKD,KAAM,MACnE,GACF,IAiCAya,IA5BA,WACY7kC,SAAS68B,eAAe,mBAC9Bp3B,iBAAiB,SAAS,WAC5BzF,SAAS6G,KAAKT,UAAY,EAC1BpG,SAASC,gBAAgBmG,UAAY,CACvC,GACF,IAuBAy+B,IArBA,WACE,IAAIE,EAAM/kC,SAAS68B,eAAe,mBAC9BmI,EAAShlC,SACVilC,uBAAuB,aAAa,GACpChnC,wBACH1D,OAAOkL,iBAAiB,UAAU,WAC5BkV,KAAKuqB,UAAYvqB,KAAKwqB,SAAWxqB,KAAKwqB,QAAUH,EAAOzsC,OACzDwsC,EAAIrpC,MAAM6wB,QAAU,QAEpBwY,EAAIrpC,MAAM6wB,QAAU,OAEtB5R,KAAKuqB,UAAYvqB,KAAKwqB,OACxB,GACF","sources":["webpack://pydata_sphinx_theme/webpack/bootstrap","webpack://pydata_sphinx_theme/webpack/runtime/define property getters","webpack://pydata_sphinx_theme/webpack/runtime/hasOwnProperty shorthand","webpack://pydata_sphinx_theme/webpack/runtime/make namespace object","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/enums.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getWindow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/applyStyles.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getBasePlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/math.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/userAgent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/contains.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/within.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/expandToHashMap.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/arrow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getVariation.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/computeStyles.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/eventListeners.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/rectToClientRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/computeOffsets.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/detectOverflow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/flip.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/hide.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/offset.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/getAltAxis.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/orderModifiers.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/createPopper.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/debounce.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/utils/mergeByName.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/popper.js","webpack://pydata_sphinx_theme/./node_modules/@popperjs/core/lib/popper-lite.js","webpack://pydata_sphinx_theme/./node_modules/bootstrap/dist/js/bootstrap.esm.js","webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/mixin.js","webpack://pydata_sphinx_theme/./src/pydata_sphinx_theme/assets/scripts/bootstrap.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };","/*!\n * Bootstrap v5.3.2 (https://getbootstrap.com/)\n * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\nimport * as Popper from '@popperjs/core';\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map();\nconst Data = {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map());\n }\n const instanceMap = elementMap.get(element);\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);\n return;\n }\n instanceMap.set(key, instance);\n },\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null;\n }\n return null;\n },\n remove(element, key) {\n if (!elementMap.has(element)) {\n return;\n }\n const instanceMap = elementMap.get(element);\n instanceMap.delete(key);\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element);\n }\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000;\nconst MILLISECONDS_MULTIPLIER = 1000;\nconst TRANSITION_END = 'transitionend';\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n if (selector && window.CSS && window.CSS.escape) {\n // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`);\n }\n return selector;\n};\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n if (object === null || object === undefined) {\n return `${object}`;\n }\n return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase();\n};\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID);\n } while (document.getElementById(prefix));\n return prefix;\n};\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element);\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n};\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END));\n};\nconst isElement = object => {\n if (!object || typeof object !== 'object') {\n return false;\n }\n if (typeof object.jquery !== 'undefined') {\n object = object[0];\n }\n return typeof object.nodeType !== 'undefined';\n};\nconst getElement = object => {\n // it's a jQuery object or a node element\n if (isElement(object)) {\n return object.jquery ? object[0] : object;\n }\n if (typeof object === 'string' && object.length > 0) {\n return document.querySelector(parseSelector(object));\n }\n return null;\n};\nconst isVisible = element => {\n if (!isElement(element) || element.getClientRects().length === 0) {\n return false;\n }\n const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';\n // Handle `details` element as its content may falsie appear visible when it is closed\n const closedDetails = element.closest('details:not([open])');\n if (!closedDetails) {\n return elementIsVisible;\n }\n if (closedDetails !== element) {\n const summary = element.closest('summary');\n if (summary && summary.parentNode !== closedDetails) {\n return false;\n }\n if (summary === null) {\n return false;\n }\n }\n return elementIsVisible;\n};\nconst isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n if (element.classList.contains('disabled')) {\n return true;\n }\n if (typeof element.disabled !== 'undefined') {\n return element.disabled;\n }\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';\n};\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null;\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n if (element instanceof ShadowRoot) {\n return element;\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null;\n }\n return findShadowRoot(element.parentNode);\n};\nconst noop = () => {};\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n element.offsetHeight; // eslint-disable-line no-unused-expressions\n};\n\nconst getjQuery = () => {\n if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return window.jQuery;\n }\n return null;\n};\nconst DOMContentLoadedCallbacks = [];\nconst onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n for (const callback of DOMContentLoadedCallbacks) {\n callback();\n }\n });\n }\n DOMContentLoadedCallbacks.push(callback);\n } else {\n callback();\n }\n};\nconst isRTL = () => document.documentElement.dir === 'rtl';\nconst defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery();\n /* istanbul ignore if */\n if ($) {\n const name = plugin.NAME;\n const JQUERY_NO_CONFLICT = $.fn[name];\n $.fn[name] = plugin.jQueryInterface;\n $.fn[name].Constructor = plugin;\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT;\n return plugin.jQueryInterface;\n };\n }\n });\n};\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;\n};\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback);\n return;\n }\n const durationPadding = 5;\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;\n let called = false;\n const handler = ({\n target\n }) => {\n if (target !== transitionElement) {\n return;\n }\n called = true;\n transitionElement.removeEventListener(TRANSITION_END, handler);\n execute(callback);\n };\n transitionElement.addEventListener(TRANSITION_END, handler);\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement);\n }\n }, emulatedDuration);\n};\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n const listLength = list.length;\n let index = list.indexOf(activeElement);\n\n // if the element does not exist in the list return an element\n // depending on the direction and if cycle is allowed\n if (index === -1) {\n return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];\n }\n index += shouldGetNext ? 1 : -1;\n if (isCycleAllowed) {\n index = (index + listLength) % listLength;\n }\n return list[Math.max(0, Math.min(index, listLength - 1))];\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/;\nconst stripNameRegex = /\\..*/;\nconst stripUidRegex = /::\\d+$/;\nconst eventRegistry = {}; // Events storage\nlet uidEvent = 1;\nconst customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n};\nconst nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;\n}\nfunction getElementEvents(element) {\n const uid = makeEventUid(element);\n element.uidEvent = uid;\n eventRegistry[uid] = eventRegistry[uid] || {};\n return eventRegistry[uid];\n}\nfunction bootstrapHandler(element, fn) {\n return function handler(event) {\n hydrateObj(event, {\n delegateTarget: element\n });\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn);\n }\n return fn.apply(element, [event]);\n };\n}\nfunction bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector);\n for (let {\n target\n } = event; target && target !== this; target = target.parentNode) {\n for (const domElement of domElements) {\n if (domElement !== target) {\n continue;\n }\n hydrateObj(event, {\n delegateTarget: target\n });\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn);\n }\n return fn.apply(target, [event]);\n }\n }\n };\n}\nfunction findHandler(events, callable, delegationSelector = null) {\n return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);\n}\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n const isDelegated = typeof handler === 'string';\n // TODO: tooltip passes `false` instead of selector, so we need to check\n const callable = isDelegated ? delegationFunction : handler || delegationFunction;\n let typeEvent = getTypeEvent(originalTypeEvent);\n if (!nativeEvents.has(typeEvent)) {\n typeEvent = originalTypeEvent;\n }\n return [isDelegated, callable, typeEvent];\n}\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n\n // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n if (originalTypeEvent in customEvents) {\n const wrapFunction = fn => {\n return function (event) {\n if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {\n return fn.call(this, event);\n }\n };\n };\n callable = wrapFunction(callable);\n }\n const events = getElementEvents(element);\n const handlers = events[typeEvent] || (events[typeEvent] = {});\n const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);\n if (previousFunction) {\n previousFunction.oneOff = previousFunction.oneOff && oneOff;\n return;\n }\n const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));\n const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);\n fn.delegationSelector = isDelegated ? handler : null;\n fn.callable = callable;\n fn.oneOff = oneOff;\n fn.uidEvent = uid;\n handlers[uid] = fn;\n element.addEventListener(typeEvent, fn, isDelegated);\n}\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector);\n if (!fn) {\n return;\n }\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));\n delete events[typeEvent][fn.uidEvent];\n}\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {};\n for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n if (handlerKey.includes(namespace)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n }\n }\n}\nfunction getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '');\n return customEvents[event] || event;\n}\nconst EventHandler = {\n on(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, false);\n },\n one(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, true);\n },\n off(element, originalTypeEvent, handler, delegationFunction) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return;\n }\n const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);\n const inNamespace = typeEvent !== originalTypeEvent;\n const events = getElementEvents(element);\n const storeElementEvent = events[typeEvent] || {};\n const isNamespace = originalTypeEvent.startsWith('.');\n if (typeof callable !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!Object.keys(storeElementEvent).length) {\n return;\n }\n removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);\n return;\n }\n if (isNamespace) {\n for (const elementEvent of Object.keys(events)) {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));\n }\n }\n for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n const handlerKey = keyHandlers.replace(stripUidRegex, '');\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);\n }\n }\n },\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null;\n }\n const $ = getjQuery();\n const typeEvent = getTypeEvent(event);\n const inNamespace = event !== typeEvent;\n let jQueryEvent = null;\n let bubbles = true;\n let nativeDispatch = true;\n let defaultPrevented = false;\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args);\n $(element).trigger(jQueryEvent);\n bubbles = !jQueryEvent.isPropagationStopped();\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();\n defaultPrevented = jQueryEvent.isDefaultPrevented();\n }\n const evt = hydrateObj(new Event(event, {\n bubbles,\n cancelable: true\n }), args);\n if (defaultPrevented) {\n evt.preventDefault();\n }\n if (nativeDispatch) {\n element.dispatchEvent(evt);\n }\n if (evt.defaultPrevented && jQueryEvent) {\n jQueryEvent.preventDefault();\n }\n return evt;\n }\n};\nfunction hydrateObj(obj, meta = {}) {\n for (const [key, value] of Object.entries(meta)) {\n try {\n obj[key] = value;\n } catch (_unused) {\n Object.defineProperty(obj, key, {\n configurable: true,\n get() {\n return value;\n }\n });\n }\n }\n return obj;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n if (value === Number(value).toString()) {\n return Number(value);\n }\n if (value === '' || value === 'null') {\n return null;\n }\n if (typeof value !== 'string') {\n return value;\n }\n try {\n return JSON.parse(decodeURIComponent(value));\n } catch (_unused) {\n return value;\n }\n}\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);\n}\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);\n },\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);\n },\n getDataAttributes(element) {\n if (!element) {\n return {};\n }\n const attributes = {};\n const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));\n for (const key of bsKeys) {\n let pureKey = key.replace(/^bs/, '');\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);\n attributes[pureKey] = normalizeData(element.dataset[key]);\n }\n return attributes;\n },\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Class definition\n */\n\nclass Config {\n // Getters\n static get Default() {\n return {};\n }\n static get DefaultType() {\n return {};\n }\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!');\n }\n _getConfig(config) {\n config = this._mergeConfigObj(config);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n _configAfterMerge(config) {\n return config;\n }\n _mergeConfigObj(config, element) {\n const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse\n\n return {\n ...this.constructor.Default,\n ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n ...(typeof config === 'object' ? config : {})\n };\n }\n _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n for (const [property, expectedTypes] of Object.entries(configTypes)) {\n const value = config[property];\n const valueType = isElement(value) ? 'element' : toType(value);\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`);\n }\n }\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.2';\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n constructor(element, config) {\n super();\n element = getElement(element);\n if (!element) {\n return;\n }\n this._element = element;\n this._config = this._getConfig(config);\n Data.set(this._element, this.constructor.DATA_KEY, this);\n }\n\n // Public\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY);\n EventHandler.off(this._element, this.constructor.EVENT_KEY);\n for (const propertyName of Object.getOwnPropertyNames(this)) {\n this[propertyName] = null;\n }\n }\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated);\n }\n _getConfig(config) {\n config = this._mergeConfigObj(config, this._element);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n\n // Static\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY);\n }\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);\n }\n static get VERSION() {\n return VERSION;\n }\n static get DATA_KEY() {\n return `bs.${this.NAME}`;\n }\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`;\n }\n static eventName(name) {\n return `${name}${this.EVENT_KEY}`;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-bs-target');\n if (!selector || selector === '#') {\n let hrefAttribute = element.getAttribute('href');\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {\n return null;\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n hrefAttribute = `#${hrefAttribute.split('#')[1]}`;\n }\n selector = hrefAttribute && hrefAttribute !== '#' ? parseSelector(hrefAttribute.trim()) : null;\n }\n return selector;\n};\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector));\n },\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector);\n },\n children(element, selector) {\n return [].concat(...element.children).filter(child => child.matches(selector));\n },\n parents(element, selector) {\n const parents = [];\n let ancestor = element.parentNode.closest(selector);\n while (ancestor) {\n parents.push(ancestor);\n ancestor = ancestor.parentNode.closest(selector);\n }\n return parents;\n },\n prev(element, selector) {\n let previous = element.previousElementSibling;\n while (previous) {\n if (previous.matches(selector)) {\n return [previous];\n }\n previous = previous.previousElementSibling;\n }\n return [];\n },\n // TODO: this is now unused; remove later along with prev()\n next(element, selector) {\n let next = element.nextElementSibling;\n while (next) {\n if (next.matches(selector)) {\n return [next];\n }\n next = next.nextElementSibling;\n }\n return [];\n },\n focusableChildren(element) {\n const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable=\"true\"]'].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',');\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));\n },\n getSelectorFromElement(element) {\n const selector = getSelector(element);\n if (selector) {\n return SelectorEngine.findOne(selector) ? selector : null;\n }\n return null;\n },\n getElementFromSelector(element) {\n const selector = getSelector(element);\n return selector ? SelectorEngine.findOne(selector) : null;\n },\n getMultipleElementsFromSelector(element) {\n const selector = getSelector(element);\n return selector ? SelectorEngine.find(selector) : [];\n }\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`;\n const name = component.NAME;\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n if (isDisabled(this)) {\n return;\n }\n const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);\n const instance = component.getOrCreateInstance(target);\n\n // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n instance[method]();\n });\n};\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$f = 'alert';\nconst DATA_KEY$a = 'bs.alert';\nconst EVENT_KEY$b = `.${DATA_KEY$a}`;\nconst EVENT_CLOSE = `close${EVENT_KEY$b}`;\nconst EVENT_CLOSED = `closed${EVENT_KEY$b}`;\nconst CLASS_NAME_FADE$5 = 'fade';\nconst CLASS_NAME_SHOW$8 = 'show';\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$f;\n }\n\n // Public\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);\n if (closeEvent.defaultPrevented) {\n return;\n }\n this._element.classList.remove(CLASS_NAME_SHOW$8);\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated);\n }\n\n // Private\n _destroyElement() {\n this._element.remove();\n EventHandler.trigger(this._element, EVENT_CLOSED);\n this.dispose();\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](this);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close');\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$e = 'button';\nconst DATA_KEY$9 = 'bs.button';\nconst EVENT_KEY$a = `.${DATA_KEY$9}`;\nconst DATA_API_KEY$6 = '.data-api';\nconst CLASS_NAME_ACTIVE$3 = 'active';\nconst SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle=\"button\"]';\nconst EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME$e;\n }\n\n // Public\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3));\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this);\n if (config === 'toggle') {\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {\n event.preventDefault();\n const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);\n const data = Button.getOrCreateInstance(button);\n data.toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$d = 'swipe';\nconst EVENT_KEY$9 = '.bs.swipe';\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`;\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`;\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`;\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`;\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`;\nconst POINTER_TYPE_TOUCH = 'touch';\nconst POINTER_TYPE_PEN = 'pen';\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event';\nconst SWIPE_THRESHOLD = 40;\nconst Default$c = {\n endCallback: null,\n leftCallback: null,\n rightCallback: null\n};\nconst DefaultType$c = {\n endCallback: '(function|null)',\n leftCallback: '(function|null)',\n rightCallback: '(function|null)'\n};\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n constructor(element, config) {\n super();\n this._element = element;\n if (!element || !Swipe.isSupported()) {\n return;\n }\n this._config = this._getConfig(config);\n this._deltaX = 0;\n this._supportPointerEvents = Boolean(window.PointerEvent);\n this._initEvents();\n }\n\n // Getters\n static get Default() {\n return Default$c;\n }\n static get DefaultType() {\n return DefaultType$c;\n }\n static get NAME() {\n return NAME$d;\n }\n\n // Public\n dispose() {\n EventHandler.off(this._element, EVENT_KEY$9);\n }\n\n // Private\n _start(event) {\n if (!this._supportPointerEvents) {\n this._deltaX = event.touches[0].clientX;\n return;\n }\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX;\n }\n }\n _end(event) {\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX - this._deltaX;\n }\n this._handleSwipe();\n execute(this._config.endCallback);\n }\n _move(event) {\n this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;\n }\n _handleSwipe() {\n const absDeltaX = Math.abs(this._deltaX);\n if (absDeltaX <= SWIPE_THRESHOLD) {\n return;\n }\n const direction = absDeltaX / this._deltaX;\n this._deltaX = 0;\n if (!direction) {\n return;\n }\n execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);\n }\n _initEvents() {\n if (this._supportPointerEvents) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event));\n EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event));\n this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event));\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));\n EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event));\n }\n }\n _eventIsPointerPenTouch(event) {\n return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);\n }\n\n // Static\n static isSupported() {\n return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$c = 'carousel';\nconst DATA_KEY$8 = 'bs.carousel';\nconst EVENT_KEY$8 = `.${DATA_KEY$8}`;\nconst DATA_API_KEY$5 = '.data-api';\nconst ARROW_LEFT_KEY$1 = 'ArrowLeft';\nconst ARROW_RIGHT_KEY$1 = 'ArrowRight';\nconst TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next';\nconst ORDER_PREV = 'prev';\nconst DIRECTION_LEFT = 'left';\nconst DIRECTION_RIGHT = 'right';\nconst EVENT_SLIDE = `slide${EVENT_KEY$8}`;\nconst EVENT_SLID = `slid${EVENT_KEY$8}`;\nconst EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`;\nconst EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`;\nconst EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`;\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`;\nconst EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;\nconst CLASS_NAME_CAROUSEL = 'carousel';\nconst CLASS_NAME_ACTIVE$2 = 'active';\nconst CLASS_NAME_SLIDE = 'slide';\nconst CLASS_NAME_END = 'carousel-item-end';\nconst CLASS_NAME_START = 'carousel-item-start';\nconst CLASS_NAME_NEXT = 'carousel-item-next';\nconst CLASS_NAME_PREV = 'carousel-item-prev';\nconst SELECTOR_ACTIVE = '.active';\nconst SELECTOR_ITEM = '.carousel-item';\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM;\nconst SELECTOR_ITEM_IMG = '.carousel-item img';\nconst SELECTOR_INDICATORS = '.carousel-indicators';\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]';\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]';\nconst KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT\n};\nconst Default$b = {\n interval: 5000,\n keyboard: true,\n pause: 'hover',\n ride: false,\n touch: true,\n wrap: true\n};\nconst DefaultType$b = {\n interval: '(number|boolean)',\n // TODO:v6 remove boolean support\n keyboard: 'boolean',\n pause: '(string|boolean)',\n ride: '(boolean|string)',\n touch: 'boolean',\n wrap: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._interval = null;\n this._activeElement = null;\n this._isSliding = false;\n this.touchTimeout = null;\n this._swipeHelper = null;\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);\n this._addEventListeners();\n if (this._config.ride === CLASS_NAME_CAROUSEL) {\n this.cycle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$b;\n }\n static get DefaultType() {\n return DefaultType$b;\n }\n static get NAME() {\n return NAME$c;\n }\n\n // Public\n next() {\n this._slide(ORDER_NEXT);\n }\n nextWhenVisible() {\n // FIXME TODO use `document.visibilityState`\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next();\n }\n }\n prev() {\n this._slide(ORDER_PREV);\n }\n pause() {\n if (this._isSliding) {\n triggerTransitionEnd(this._element);\n }\n this._clearInterval();\n }\n cycle() {\n this._clearInterval();\n this._updateInterval();\n this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval);\n }\n _maybeEnableCycle() {\n if (!this._config.ride) {\n return;\n }\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.cycle());\n return;\n }\n this.cycle();\n }\n to(index) {\n const items = this._getItems();\n if (index > items.length - 1 || index < 0) {\n return;\n }\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index));\n return;\n }\n const activeIndex = this._getItemIndex(this._getActive());\n if (activeIndex === index) {\n return;\n }\n const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV;\n this._slide(order, items[index]);\n }\n dispose() {\n if (this._swipeHelper) {\n this._swipeHelper.dispose();\n }\n super.dispose();\n }\n\n // Private\n _configAfterMerge(config) {\n config.defaultInterval = config.interval;\n return config;\n }\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event));\n }\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause());\n EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle());\n }\n if (this._config.touch && Swipe.isSupported()) {\n this._addTouchEventListeners();\n }\n }\n _addTouchEventListeners() {\n for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault());\n }\n const endCallBack = () => {\n if (this._config.pause !== 'hover') {\n return;\n }\n\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause();\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout);\n }\n this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval);\n };\n const swipeConfig = {\n leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n endCallback: endCallBack\n };\n this._swipeHelper = new Swipe(this._element, swipeConfig);\n }\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n const direction = KEY_TO_DIRECTION[event.key];\n if (direction) {\n event.preventDefault();\n this._slide(this._directionToOrder(direction));\n }\n }\n _getItemIndex(element) {\n return this._getItems().indexOf(element);\n }\n _setActiveIndicatorElement(index) {\n if (!this._indicatorsElement) {\n return;\n }\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement);\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2);\n activeIndicator.removeAttribute('aria-current');\n const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement);\n if (newActiveIndicator) {\n newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2);\n newActiveIndicator.setAttribute('aria-current', 'true');\n }\n }\n _updateInterval() {\n const element = this._activeElement || this._getActive();\n if (!element) {\n return;\n }\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10);\n this._config.interval = elementInterval || this._config.defaultInterval;\n }\n _slide(order, element = null) {\n if (this._isSliding) {\n return;\n }\n const activeElement = this._getActive();\n const isNext = order === ORDER_NEXT;\n const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap);\n if (nextElement === activeElement) {\n return;\n }\n const nextElementIndex = this._getItemIndex(nextElement);\n const triggerEvent = eventName => {\n return EventHandler.trigger(this._element, eventName, {\n relatedTarget: nextElement,\n direction: this._orderToDirection(order),\n from: this._getItemIndex(activeElement),\n to: nextElementIndex\n });\n };\n const slideEvent = triggerEvent(EVENT_SLIDE);\n if (slideEvent.defaultPrevented) {\n return;\n }\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n // TODO: change tests that use empty divs to avoid this check\n return;\n }\n const isCycling = Boolean(this._interval);\n this.pause();\n this._isSliding = true;\n this._setActiveIndicatorElement(nextElementIndex);\n this._activeElement = nextElement;\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END;\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV;\n nextElement.classList.add(orderClassName);\n reflow(nextElement);\n activeElement.classList.add(directionalClassName);\n nextElement.classList.add(directionalClassName);\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName);\n nextElement.classList.add(CLASS_NAME_ACTIVE$2);\n activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName);\n this._isSliding = false;\n triggerEvent(EVENT_SLID);\n };\n this._queueCallback(completeCallBack, activeElement, this._isAnimated());\n if (isCycling) {\n this.cycle();\n }\n }\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_SLIDE);\n }\n _getActive() {\n return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);\n }\n _getItems() {\n return SelectorEngine.find(SELECTOR_ITEM, this._element);\n }\n _clearInterval() {\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n }\n _directionToOrder(direction) {\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;\n }\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;\n }\n _orderToDirection(order) {\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;\n }\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Carousel.getOrCreateInstance(this, config);\n if (typeof config === 'number') {\n data.to(config);\n return;\n }\n if (typeof config === 'string') {\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return;\n }\n event.preventDefault();\n const carousel = Carousel.getOrCreateInstance(target);\n const slideIndex = this.getAttribute('data-bs-slide-to');\n if (slideIndex) {\n carousel.to(slideIndex);\n carousel._maybeEnableCycle();\n return;\n }\n if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n carousel.next();\n carousel._maybeEnableCycle();\n return;\n }\n carousel.prev();\n carousel._maybeEnableCycle();\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$3, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);\n for (const carousel of carousels) {\n Carousel.getOrCreateInstance(carousel);\n }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$b = 'collapse';\nconst DATA_KEY$7 = 'bs.collapse';\nconst EVENT_KEY$7 = `.${DATA_KEY$7}`;\nconst DATA_API_KEY$4 = '.data-api';\nconst EVENT_SHOW$6 = `show${EVENT_KEY$7}`;\nconst EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`;\nconst EVENT_HIDE$6 = `hide${EVENT_KEY$7}`;\nconst EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`;\nconst EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;\nconst CLASS_NAME_SHOW$7 = 'show';\nconst CLASS_NAME_COLLAPSE = 'collapse';\nconst CLASS_NAME_COLLAPSING = 'collapsing';\nconst CLASS_NAME_COLLAPSED = 'collapsed';\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal';\nconst WIDTH = 'width';\nconst HEIGHT = 'height';\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';\nconst SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle=\"collapse\"]';\nconst Default$a = {\n parent: null,\n toggle: true\n};\nconst DefaultType$a = {\n parent: '(null|element)',\n toggle: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._isTransitioning = false;\n this._triggerArray = [];\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);\n for (const elem of toggleList) {\n const selector = SelectorEngine.getSelectorFromElement(elem);\n const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);\n if (selector !== null && filterElement.length) {\n this._triggerArray.push(elem);\n }\n }\n this._initializeChildren();\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());\n }\n if (this._config.toggle) {\n this.toggle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$a;\n }\n static get DefaultType() {\n return DefaultType$a;\n }\n static get NAME() {\n return NAME$b;\n }\n\n // Public\n toggle() {\n if (this._isShown()) {\n this.hide();\n } else {\n this.show();\n }\n }\n show() {\n if (this._isTransitioning || this._isShown()) {\n return;\n }\n let activeChildren = [];\n\n // find active children\n if (this._config.parent) {\n activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, {\n toggle: false\n }));\n }\n if (activeChildren.length && activeChildren[0]._isTransitioning) {\n return;\n }\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6);\n if (startEvent.defaultPrevented) {\n return;\n }\n for (const activeInstance of activeChildren) {\n activeInstance.hide();\n }\n const dimension = this._getDimension();\n this._element.classList.remove(CLASS_NAME_COLLAPSE);\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n this._element.style[dimension] = 0;\n this._addAriaAndCollapsedClass(this._triggerArray, true);\n this._isTransitioning = true;\n const complete = () => {\n this._isTransitioning = false;\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n this._element.style[dimension] = '';\n EventHandler.trigger(this._element, EVENT_SHOWN$6);\n };\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n const scrollSize = `scroll${capitalizedDimension}`;\n this._queueCallback(complete, this._element, true);\n this._element.style[dimension] = `${this._element[scrollSize]}px`;\n }\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return;\n }\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6);\n if (startEvent.defaultPrevented) {\n return;\n }\n const dimension = this._getDimension();\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;\n reflow(this._element);\n this._element.classList.add(CLASS_NAME_COLLAPSING);\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);\n for (const trigger of this._triggerArray) {\n const element = SelectorEngine.getElementFromSelector(trigger);\n if (element && !this._isShown(element)) {\n this._addAriaAndCollapsedClass([trigger], false);\n }\n }\n this._isTransitioning = true;\n const complete = () => {\n this._isTransitioning = false;\n this._element.classList.remove(CLASS_NAME_COLLAPSING);\n this._element.classList.add(CLASS_NAME_COLLAPSE);\n EventHandler.trigger(this._element, EVENT_HIDDEN$6);\n };\n this._element.style[dimension] = '';\n this._queueCallback(complete, this._element, true);\n }\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW$7);\n }\n\n // Private\n _configAfterMerge(config) {\n config.toggle = Boolean(config.toggle); // Coerce string values\n config.parent = getElement(config.parent);\n return config;\n }\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;\n }\n _initializeChildren() {\n if (!this._config.parent) {\n return;\n }\n const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);\n for (const element of children) {\n const selected = SelectorEngine.getElementFromSelector(element);\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected));\n }\n }\n }\n _getFirstLevelChildren(selector) {\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);\n // remove children if greater depth\n return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element));\n }\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return;\n }\n for (const element of triggerArray) {\n element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen);\n element.setAttribute('aria-expanded', isOpen);\n }\n }\n\n // Static\n static jQueryInterface(config) {\n const _config = {};\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n return this.each(function () {\n const data = Collapse.getOrCreateInstance(this, _config);\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {\n event.preventDefault();\n }\n for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n Collapse.getOrCreateInstance(element, {\n toggle: false\n }).toggle();\n }\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$a = 'dropdown';\nconst DATA_KEY$6 = 'bs.dropdown';\nconst EVENT_KEY$6 = `.${DATA_KEY$6}`;\nconst DATA_API_KEY$3 = '.data-api';\nconst ESCAPE_KEY$2 = 'Escape';\nconst TAB_KEY$1 = 'Tab';\nconst ARROW_UP_KEY$1 = 'ArrowUp';\nconst ARROW_DOWN_KEY$1 = 'ArrowDown';\nconst RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE$5 = `hide${EVENT_KEY$6}`;\nconst EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`;\nconst EVENT_SHOW$5 = `show${EVENT_KEY$6}`;\nconst EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`;\nconst EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`;\nconst CLASS_NAME_SHOW$6 = 'show';\nconst CLASS_NAME_DROPUP = 'dropup';\nconst CLASS_NAME_DROPEND = 'dropend';\nconst CLASS_NAME_DROPSTART = 'dropstart';\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center';\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';\nconst SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)';\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`;\nconst SELECTOR_MENU = '.dropdown-menu';\nconst SELECTOR_NAVBAR = '.navbar';\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav';\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start';\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end';\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start';\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';\nconst PLACEMENT_TOPCENTER = 'top';\nconst PLACEMENT_BOTTOMCENTER = 'bottom';\nconst Default$9 = {\n autoClose: true,\n boundary: 'clippingParents',\n display: 'dynamic',\n offset: [0, 2],\n popperConfig: null,\n reference: 'toggle'\n};\nconst DefaultType$9 = {\n autoClose: '(boolean|string)',\n boundary: '(string|element)',\n display: 'string',\n offset: '(array|string|function)',\n popperConfig: '(null|object|function)',\n reference: '(string|element|object)'\n};\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._popper = null;\n this._parent = this._element.parentNode; // dropdown wrapper\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);\n this._inNavbar = this._detectNavbar();\n }\n\n // Getters\n static get Default() {\n return Default$9;\n }\n static get DefaultType() {\n return DefaultType$9;\n }\n static get NAME() {\n return NAME$a;\n }\n\n // Public\n toggle() {\n return this._isShown() ? this.hide() : this.show();\n }\n show() {\n if (isDisabled(this._element) || this._isShown()) {\n return;\n }\n const relatedTarget = {\n relatedTarget: this._element\n };\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget);\n if (showEvent.defaultPrevented) {\n return;\n }\n this._createPopper();\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop);\n }\n }\n this._element.focus();\n this._element.setAttribute('aria-expanded', true);\n this._menu.classList.add(CLASS_NAME_SHOW$6);\n this._element.classList.add(CLASS_NAME_SHOW$6);\n EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget);\n }\n hide() {\n if (isDisabled(this._element) || !this._isShown()) {\n return;\n }\n const relatedTarget = {\n relatedTarget: this._element\n };\n this._completeHide(relatedTarget);\n }\n dispose() {\n if (this._popper) {\n this._popper.destroy();\n }\n super.dispose();\n }\n update() {\n this._inNavbar = this._detectNavbar();\n if (this._popper) {\n this._popper.update();\n }\n }\n\n // Private\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget);\n if (hideEvent.defaultPrevented) {\n return;\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop);\n }\n }\n if (this._popper) {\n this._popper.destroy();\n }\n this._menu.classList.remove(CLASS_NAME_SHOW$6);\n this._element.classList.remove(CLASS_NAME_SHOW$6);\n this._element.setAttribute('aria-expanded', 'false');\n Manipulator.removeDataAttribute(this._menu, 'popper');\n EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget);\n }\n _getConfig(config) {\n config = super._getConfig(config);\n if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME$a.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`);\n }\n return config;\n }\n _createPopper() {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)');\n }\n let referenceElement = this._element;\n if (this._config.reference === 'parent') {\n referenceElement = this._parent;\n } else if (isElement(this._config.reference)) {\n referenceElement = getElement(this._config.reference);\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference;\n }\n const popperConfig = this._getPopperConfig();\n this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig);\n }\n _isShown() {\n return this._menu.classList.contains(CLASS_NAME_SHOW$6);\n }\n _getPlacement() {\n const parentDropdown = this._parent;\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n return PLACEMENT_TOPCENTER;\n }\n if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n return PLACEMENT_BOTTOMCENTER;\n }\n\n // We need to trim the value because custom properties can also include spaces\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n }\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;\n }\n _detectNavbar() {\n return this._element.closest(SELECTOR_NAVBAR) !== null;\n }\n _getOffset() {\n const {\n offset\n } = this._config;\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10));\n }\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n return offset;\n }\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n };\n\n // Disable Popper if we have a static display or Dropdown is in Navbar\n if (this._inNavbar || this._config.display === 'static') {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }];\n }\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n };\n }\n _selectMenuItem({\n key,\n target\n }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element));\n if (!items.length) {\n return;\n }\n\n // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus();\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n static clearMenus(event) {\n if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) {\n return;\n }\n const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);\n for (const toggle of openToggles) {\n const context = Dropdown.getInstance(toggle);\n if (!context || context._config.autoClose === false) {\n continue;\n }\n const composedPath = event.composedPath();\n const isMenuTarget = composedPath.includes(context._menu);\n if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {\n continue;\n }\n\n // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue;\n }\n const relatedTarget = {\n relatedTarget: context._element\n };\n if (event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n context._completeHide(relatedTarget);\n }\n }\n static dataApiKeydownHandler(event) {\n // If not an UP | DOWN | ESCAPE key => not a dropdown command\n // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n const isInput = /input|textarea/i.test(event.target.tagName);\n const isEscapeEvent = event.key === ESCAPE_KEY$2;\n const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key);\n if (!isUpOrDownEvent && !isEscapeEvent) {\n return;\n }\n if (isInput && !isEscapeEvent) {\n return;\n }\n event.preventDefault();\n\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);\n const instance = Dropdown.getOrCreateInstance(getToggleButton);\n if (isUpOrDownEvent) {\n event.stopPropagation();\n instance.show();\n instance._selectMenuItem(event);\n return;\n }\n if (instance._isShown()) {\n // else is escape and we check if it is shown\n event.stopPropagation();\n instance.hide();\n getToggleButton.focus();\n }\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);\nEventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {\n event.preventDefault();\n Dropdown.getOrCreateInstance(this).toggle();\n});\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$9 = 'backdrop';\nconst CLASS_NAME_FADE$4 = 'fade';\nconst CLASS_NAME_SHOW$5 = 'show';\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`;\nconst Default$8 = {\n className: 'modal-backdrop',\n clickCallback: null,\n isAnimated: false,\n isVisible: true,\n // if false, we use the backdrop helper without adding any element to the dom\n rootElement: 'body' // give the choice to place backdrop under different elements\n};\n\nconst DefaultType$8 = {\n className: 'string',\n clickCallback: '(function|null)',\n isAnimated: 'boolean',\n isVisible: 'boolean',\n rootElement: '(element|string)'\n};\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n this._isAppended = false;\n this._element = null;\n }\n\n // Getters\n static get Default() {\n return Default$8;\n }\n static get DefaultType() {\n return DefaultType$8;\n }\n static get NAME() {\n return NAME$9;\n }\n\n // Public\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n this._append();\n const element = this._getElement();\n if (this._config.isAnimated) {\n reflow(element);\n }\n element.classList.add(CLASS_NAME_SHOW$5);\n this._emulateAnimation(() => {\n execute(callback);\n });\n }\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback);\n return;\n }\n this._getElement().classList.remove(CLASS_NAME_SHOW$5);\n this._emulateAnimation(() => {\n this.dispose();\n execute(callback);\n });\n }\n dispose() {\n if (!this._isAppended) {\n return;\n }\n EventHandler.off(this._element, EVENT_MOUSEDOWN);\n this._element.remove();\n this._isAppended = false;\n }\n\n // Private\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div');\n backdrop.className = this._config.className;\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE$4);\n }\n this._element = backdrop;\n }\n return this._element;\n }\n _configAfterMerge(config) {\n // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n config.rootElement = getElement(config.rootElement);\n return config;\n }\n _append() {\n if (this._isAppended) {\n return;\n }\n const element = this._getElement();\n this._config.rootElement.append(element);\n EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback);\n });\n this._isAppended = true;\n }\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated);\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$8 = 'focustrap';\nconst DATA_KEY$5 = 'bs.focustrap';\nconst EVENT_KEY$5 = `.${DATA_KEY$5}`;\nconst EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`;\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`;\nconst TAB_KEY = 'Tab';\nconst TAB_NAV_FORWARD = 'forward';\nconst TAB_NAV_BACKWARD = 'backward';\nconst Default$7 = {\n autofocus: true,\n trapElement: null // The element to trap focus inside of\n};\n\nconst DefaultType$7 = {\n autofocus: 'boolean',\n trapElement: 'element'\n};\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n this._isActive = false;\n this._lastTabNavDirection = null;\n }\n\n // Getters\n static get Default() {\n return Default$7;\n }\n static get DefaultType() {\n return DefaultType$7;\n }\n static get NAME() {\n return NAME$8;\n }\n\n // Public\n activate() {\n if (this._isActive) {\n return;\n }\n if (this._config.autofocus) {\n this._config.trapElement.focus();\n }\n EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop\n EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event));\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));\n this._isActive = true;\n }\n deactivate() {\n if (!this._isActive) {\n return;\n }\n this._isActive = false;\n EventHandler.off(document, EVENT_KEY$5);\n }\n\n // Private\n _handleFocusin(event) {\n const {\n trapElement\n } = this._config;\n if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n return;\n }\n const elements = SelectorEngine.focusableChildren(trapElement);\n if (elements.length === 0) {\n trapElement.focus();\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus();\n } else {\n elements[0].focus();\n }\n }\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return;\n }\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';\nconst SELECTOR_STICKY_CONTENT = '.sticky-top';\nconst PROPERTY_PADDING = 'padding-right';\nconst PROPERTY_MARGIN = 'margin-right';\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n constructor() {\n this._element = document.body;\n }\n\n // Public\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n }\n hide() {\n const width = this.getWidth();\n this._disableOverFlow();\n // give padding to element to balance the hidden scrollbar width\n this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);\n }\n reset() {\n this._resetElementAttributes(this._element, 'overflow');\n this._resetElementAttributes(this._element, PROPERTY_PADDING);\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);\n }\n isOverflowing() {\n return this.getWidth() > 0;\n }\n\n // Private\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow');\n this._element.style.overflow = 'hidden';\n }\n _setElementAttributes(selector, styleProperty, callback) {\n const scrollbarWidth = this.getWidth();\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return;\n }\n this._saveInitialAttribute(element, styleProperty);\n const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);\n element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);\n };\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n _saveInitialAttribute(element, styleProperty) {\n const actualValue = element.style.getPropertyValue(styleProperty);\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProperty, actualValue);\n }\n }\n _resetElementAttributes(selector, styleProperty) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProperty);\n // We only want to remove the property if the value is `null`; the value can also be zero\n if (value === null) {\n element.style.removeProperty(styleProperty);\n return;\n }\n Manipulator.removeDataAttribute(element, styleProperty);\n element.style.setProperty(styleProperty, value);\n };\n this._applyManipulationCallback(selector, manipulationCallBack);\n }\n _applyManipulationCallback(selector, callBack) {\n if (isElement(selector)) {\n callBack(selector);\n return;\n }\n for (const sel of SelectorEngine.find(selector, this._element)) {\n callBack(sel);\n }\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$7 = 'modal';\nconst DATA_KEY$4 = 'bs.modal';\nconst EVENT_KEY$4 = `.${DATA_KEY$4}`;\nconst DATA_API_KEY$2 = '.data-api';\nconst ESCAPE_KEY$1 = 'Escape';\nconst EVENT_HIDE$4 = `hide${EVENT_KEY$4}`;\nconst EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`;\nconst EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`;\nconst EVENT_SHOW$4 = `show${EVENT_KEY$4}`;\nconst EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`;\nconst EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`;\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`;\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`;\nconst EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`;\nconst EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`;\nconst CLASS_NAME_OPEN = 'modal-open';\nconst CLASS_NAME_FADE$3 = 'fade';\nconst CLASS_NAME_SHOW$4 = 'show';\nconst CLASS_NAME_STATIC = 'modal-static';\nconst OPEN_SELECTOR$1 = '.modal.show';\nconst SELECTOR_DIALOG = '.modal-dialog';\nconst SELECTOR_MODAL_BODY = '.modal-body';\nconst SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle=\"modal\"]';\nconst Default$6 = {\n backdrop: true,\n focus: true,\n keyboard: true\n};\nconst DefaultType$6 = {\n backdrop: '(boolean|string)',\n focus: 'boolean',\n keyboard: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._isShown = false;\n this._isTransitioning = false;\n this._scrollBar = new ScrollBarHelper();\n this._addEventListeners();\n }\n\n // Getters\n static get Default() {\n return Default$6;\n }\n static get DefaultType() {\n return DefaultType$6;\n }\n static get NAME() {\n return NAME$7;\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, {\n relatedTarget\n });\n if (showEvent.defaultPrevented) {\n return;\n }\n this._isShown = true;\n this._isTransitioning = true;\n this._scrollBar.hide();\n document.body.classList.add(CLASS_NAME_OPEN);\n this._adjustDialog();\n this._backdrop.show(() => this._showElement(relatedTarget));\n }\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);\n if (hideEvent.defaultPrevented) {\n return;\n }\n this._isShown = false;\n this._isTransitioning = true;\n this._focustrap.deactivate();\n this._element.classList.remove(CLASS_NAME_SHOW$4);\n this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());\n }\n dispose() {\n EventHandler.off(window, EVENT_KEY$4);\n EventHandler.off(this._dialog, EVENT_KEY$4);\n this._backdrop.dispose();\n this._focustrap.deactivate();\n super.dispose();\n }\n handleUpdate() {\n this._adjustDialog();\n }\n\n // Private\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop),\n // 'static' option will be translated to true, and booleans will keep their value,\n isAnimated: this._isAnimated()\n });\n }\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n _showElement(relatedTarget) {\n // try to append dynamic modal\n if (!document.body.contains(this._element)) {\n document.body.append(this._element);\n }\n this._element.style.display = 'block';\n this._element.removeAttribute('aria-hidden');\n this._element.setAttribute('aria-modal', true);\n this._element.setAttribute('role', 'dialog');\n this._element.scrollTop = 0;\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);\n if (modalBody) {\n modalBody.scrollTop = 0;\n }\n reflow(this._element);\n this._element.classList.add(CLASS_NAME_SHOW$4);\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate();\n }\n this._isTransitioning = false;\n EventHandler.trigger(this._element, EVENT_SHOWN$4, {\n relatedTarget\n });\n };\n this._queueCallback(transitionComplete, this._dialog, this._isAnimated());\n }\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {\n if (event.key !== ESCAPE_KEY$1) {\n return;\n }\n if (this._config.keyboard) {\n this.hide();\n return;\n }\n this._triggerBackdropTransition();\n });\n EventHandler.on(window, EVENT_RESIZE$1, () => {\n if (this._isShown && !this._isTransitioning) {\n this._adjustDialog();\n }\n });\n EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n if (this._element !== event.target || this._element !== event2.target) {\n return;\n }\n if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition();\n return;\n }\n if (this._config.backdrop) {\n this.hide();\n }\n });\n });\n }\n _hideModal() {\n this._element.style.display = 'none';\n this._element.setAttribute('aria-hidden', true);\n this._element.removeAttribute('aria-modal');\n this._element.removeAttribute('role');\n this._isTransitioning = false;\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN);\n this._resetAdjustments();\n this._scrollBar.reset();\n EventHandler.trigger(this._element, EVENT_HIDDEN$4);\n });\n }\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE$3);\n }\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1);\n if (hideEvent.defaultPrevented) {\n return;\n }\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n const initialOverflowY = this._element.style.overflowY;\n // return if the following background transition hasn't yet completed\n if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n return;\n }\n if (!isModalOverflowing) {\n this._element.style.overflowY = 'hidden';\n }\n this._element.classList.add(CLASS_NAME_STATIC);\n this._queueCallback(() => {\n this._element.classList.remove(CLASS_NAME_STATIC);\n this._queueCallback(() => {\n this._element.style.overflowY = initialOverflowY;\n }, this._dialog);\n }, this._dialog);\n this._element.focus();\n }\n\n /**\n * The following methods are used to handle overflowing modals\n */\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n const scrollbarWidth = this._scrollBar.getWidth();\n const isBodyOverflowing = scrollbarWidth > 0;\n if (isBodyOverflowing && !isModalOverflowing) {\n const property = isRTL() ? 'paddingLeft' : 'paddingRight';\n this._element.style[property] = `${scrollbarWidth}px`;\n }\n if (!isBodyOverflowing && isModalOverflowing) {\n const property = isRTL() ? 'paddingRight' : 'paddingLeft';\n this._element.style[property] = `${scrollbarWidth}px`;\n }\n }\n _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n }\n\n // Static\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](relatedTarget);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n EventHandler.one(target, EVENT_SHOW$4, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return;\n }\n EventHandler.one(target, EVENT_HIDDEN$4, () => {\n if (isVisible(this)) {\n this.focus();\n }\n });\n });\n\n // avoid conflict when clicking modal toggler while another one is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);\n if (alreadyOpen) {\n Modal.getInstance(alreadyOpen).hide();\n }\n const data = Modal.getOrCreateInstance(target);\n data.toggle(this);\n});\nenableDismissTrigger(Modal);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$6 = 'offcanvas';\nconst DATA_KEY$3 = 'bs.offcanvas';\nconst EVENT_KEY$3 = `.${DATA_KEY$3}`;\nconst DATA_API_KEY$1 = '.data-api';\nconst EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst ESCAPE_KEY = 'Escape';\nconst CLASS_NAME_SHOW$3 = 'show';\nconst CLASS_NAME_SHOWING$1 = 'showing';\nconst CLASS_NAME_HIDING = 'hiding';\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop';\nconst OPEN_SELECTOR = '.offcanvas.show';\nconst EVENT_SHOW$3 = `show${EVENT_KEY$3}`;\nconst EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`;\nconst EVENT_HIDE$3 = `hide${EVENT_KEY$3}`;\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`;\nconst EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`;\nconst EVENT_RESIZE = `resize${EVENT_KEY$3}`;\nconst EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`;\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`;\nconst SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle=\"offcanvas\"]';\nconst Default$5 = {\n backdrop: true,\n keyboard: true,\n scroll: false\n};\nconst DefaultType$5 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n scroll: 'boolean'\n};\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n this._isShown = false;\n this._backdrop = this._initializeBackDrop();\n this._focustrap = this._initializeFocusTrap();\n this._addEventListeners();\n }\n\n // Getters\n static get Default() {\n return Default$5;\n }\n static get DefaultType() {\n return DefaultType$5;\n }\n static get NAME() {\n return NAME$6;\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n }\n show(relatedTarget) {\n if (this._isShown) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {\n relatedTarget\n });\n if (showEvent.defaultPrevented) {\n return;\n }\n this._isShown = true;\n this._backdrop.show();\n if (!this._config.scroll) {\n new ScrollBarHelper().hide();\n }\n this._element.setAttribute('aria-modal', true);\n this._element.setAttribute('role', 'dialog');\n this._element.classList.add(CLASS_NAME_SHOWING$1);\n const completeCallBack = () => {\n if (!this._config.scroll || this._config.backdrop) {\n this._focustrap.activate();\n }\n this._element.classList.add(CLASS_NAME_SHOW$3);\n this._element.classList.remove(CLASS_NAME_SHOWING$1);\n EventHandler.trigger(this._element, EVENT_SHOWN$3, {\n relatedTarget\n });\n };\n this._queueCallback(completeCallBack, this._element, true);\n }\n hide() {\n if (!this._isShown) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3);\n if (hideEvent.defaultPrevented) {\n return;\n }\n this._focustrap.deactivate();\n this._element.blur();\n this._isShown = false;\n this._element.classList.add(CLASS_NAME_HIDING);\n this._backdrop.hide();\n const completeCallback = () => {\n this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING);\n this._element.removeAttribute('aria-modal');\n this._element.removeAttribute('role');\n if (!this._config.scroll) {\n new ScrollBarHelper().reset();\n }\n EventHandler.trigger(this._element, EVENT_HIDDEN$3);\n };\n this._queueCallback(completeCallback, this._element, true);\n }\n dispose() {\n this._backdrop.dispose();\n this._focustrap.deactivate();\n super.dispose();\n }\n\n // Private\n _initializeBackDrop() {\n const clickCallback = () => {\n if (this._config.backdrop === 'static') {\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n return;\n }\n this.hide();\n };\n\n // 'static' option will be translated to true, and booleans will keep their value\n const isVisible = Boolean(this._config.backdrop);\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: isVisible ? clickCallback : null\n });\n }\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n });\n }\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (event.key !== ESCAPE_KEY) {\n return;\n }\n if (this._config.keyboard) {\n this.hide();\n return;\n }\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);\n });\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config](this);\n });\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {\n const target = SelectorEngine.getElementFromSelector(this);\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault();\n }\n if (isDisabled(this)) {\n return;\n }\n EventHandler.one(target, EVENT_HIDDEN$3, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus();\n }\n });\n\n // avoid conflict when clicking a toggler of an offcanvas, while another is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);\n if (alreadyOpen && alreadyOpen !== target) {\n Offcanvas.getInstance(alreadyOpen).hide();\n }\n const data = Offcanvas.getOrCreateInstance(target);\n data.toggle(this);\n});\nEventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {\n for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n Offcanvas.getOrCreateInstance(selector).show();\n }\n});\nEventHandler.on(window, EVENT_RESIZE, () => {\n for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n if (getComputedStyle(element).position !== 'fixed') {\n Offcanvas.getOrCreateInstance(element).hide();\n }\n }\n});\nenableDismissTrigger(Offcanvas);\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\nconst DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n};\n// js-docs-end allow-list\n\nconst uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\n// eslint-disable-next-line unicorn/better-regex\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n const attributeName = attribute.nodeName.toLowerCase();\n if (allowedAttributeList.includes(attributeName)) {\n if (uriAttributes.has(attributeName)) {\n return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));\n }\n return true;\n }\n\n // Check if a regular expression validates the attribute.\n return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));\n};\nfunction sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n if (!unsafeHtml.length) {\n return unsafeHtml;\n }\n if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n return sanitizeFunction(unsafeHtml);\n }\n const domParser = new window.DOMParser();\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'));\n for (const element of elements) {\n const elementName = element.nodeName.toLowerCase();\n if (!Object.keys(allowList).includes(elementName)) {\n element.remove();\n continue;\n }\n const attributeList = [].concat(...element.attributes);\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);\n for (const attribute of attributeList) {\n if (!allowedAttribute(attribute, allowedAttributes)) {\n element.removeAttribute(attribute.nodeName);\n }\n }\n }\n return createdDocument.body.innerHTML;\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$5 = 'TemplateFactory';\nconst Default$4 = {\n allowList: DefaultAllowlist,\n content: {},\n // { selector : text , selector2 : text2 , }\n extraClass: '',\n html: false,\n sanitize: true,\n sanitizeFn: null,\n template: '
'\n};\nconst DefaultType$4 = {\n allowList: 'object',\n content: 'object',\n extraClass: '(string|function)',\n html: 'boolean',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n template: 'string'\n};\nconst DefaultContentType = {\n entry: '(string|element|function|null)',\n selector: '(string|element)'\n};\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n constructor(config) {\n super();\n this._config = this._getConfig(config);\n }\n\n // Getters\n static get Default() {\n return Default$4;\n }\n static get DefaultType() {\n return DefaultType$4;\n }\n static get NAME() {\n return NAME$5;\n }\n\n // Public\n getContent() {\n return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);\n }\n hasContent() {\n return this.getContent().length > 0;\n }\n changeContent(content) {\n this._checkContent(content);\n this._config.content = {\n ...this._config.content,\n ...content\n };\n return this;\n }\n toHtml() {\n const templateWrapper = document.createElement('div');\n templateWrapper.innerHTML = this._maybeSanitize(this._config.template);\n for (const [selector, text] of Object.entries(this._config.content)) {\n this._setContent(templateWrapper, text, selector);\n }\n const template = templateWrapper.children[0];\n const extraClass = this._resolvePossibleFunction(this._config.extraClass);\n if (extraClass) {\n template.classList.add(...extraClass.split(' '));\n }\n return template;\n }\n\n // Private\n _typeCheckConfig(config) {\n super._typeCheckConfig(config);\n this._checkContent(config.content);\n }\n _checkContent(arg) {\n for (const [selector, content] of Object.entries(arg)) {\n super._typeCheckConfig({\n selector,\n entry: content\n }, DefaultContentType);\n }\n }\n _setContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template);\n if (!templateElement) {\n return;\n }\n content = this._resolvePossibleFunction(content);\n if (!content) {\n templateElement.remove();\n return;\n }\n if (isElement(content)) {\n this._putElementInTemplate(getElement(content), templateElement);\n return;\n }\n if (this._config.html) {\n templateElement.innerHTML = this._maybeSanitize(content);\n return;\n }\n templateElement.textContent = content;\n }\n _maybeSanitize(arg) {\n return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;\n }\n _resolvePossibleFunction(arg) {\n return execute(arg, [this]);\n }\n _putElementInTemplate(element, templateElement) {\n if (this._config.html) {\n templateElement.innerHTML = '';\n templateElement.append(element);\n return;\n }\n templateElement.textContent = element.textContent;\n }\n}\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$4 = 'tooltip';\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);\nconst CLASS_NAME_FADE$2 = 'fade';\nconst CLASS_NAME_MODAL = 'modal';\nconst CLASS_NAME_SHOW$2 = 'show';\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner';\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;\nconst EVENT_MODAL_HIDE = 'hide.bs.modal';\nconst TRIGGER_HOVER = 'hover';\nconst TRIGGER_FOCUS = 'focus';\nconst TRIGGER_CLICK = 'click';\nconst TRIGGER_MANUAL = 'manual';\nconst EVENT_HIDE$2 = 'hide';\nconst EVENT_HIDDEN$2 = 'hidden';\nconst EVENT_SHOW$2 = 'show';\nconst EVENT_SHOWN$2 = 'shown';\nconst EVENT_INSERTED = 'inserted';\nconst EVENT_CLICK$1 = 'click';\nconst EVENT_FOCUSIN$1 = 'focusin';\nconst EVENT_FOCUSOUT$1 = 'focusout';\nconst EVENT_MOUSEENTER = 'mouseenter';\nconst EVENT_MOUSELEAVE = 'mouseleave';\nconst AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n};\nconst Default$3 = {\n allowList: DefaultAllowlist,\n animation: true,\n boundary: 'clippingParents',\n container: false,\n customClass: '',\n delay: 0,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n html: false,\n offset: [0, 6],\n placement: 'top',\n popperConfig: null,\n sanitize: true,\n sanitizeFn: null,\n selector: false,\n template: '
' + '
' + '
' + '
',\n title: '',\n trigger: 'hover focus'\n};\nconst DefaultType$3 = {\n allowList: 'object',\n animation: 'boolean',\n boundary: '(string|element)',\n container: '(string|element|boolean)',\n customClass: '(string|function)',\n delay: '(number|object)',\n fallbackPlacements: 'array',\n html: 'boolean',\n offset: '(array|string|function)',\n placement: '(string|function)',\n popperConfig: '(null|object|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n selector: '(string|boolean)',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string'\n};\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)');\n }\n super(element, config);\n\n // Private\n this._isEnabled = true;\n this._timeout = 0;\n this._isHovered = null;\n this._activeTrigger = {};\n this._popper = null;\n this._templateFactory = null;\n this._newContent = null;\n\n // Protected\n this.tip = null;\n this._setListeners();\n if (!this._config.selector) {\n this._fixTitle();\n }\n }\n\n // Getters\n static get Default() {\n return Default$3;\n }\n static get DefaultType() {\n return DefaultType$3;\n }\n static get NAME() {\n return NAME$4;\n }\n\n // Public\n enable() {\n this._isEnabled = true;\n }\n disable() {\n this._isEnabled = false;\n }\n toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n }\n toggle() {\n if (!this._isEnabled) {\n return;\n }\n this._activeTrigger.click = !this._activeTrigger.click;\n if (this._isShown()) {\n this._leave();\n return;\n }\n this._enter();\n }\n dispose() {\n clearTimeout(this._timeout);\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n if (this._element.getAttribute('data-bs-original-title')) {\n this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));\n }\n this._disposePopper();\n super.dispose();\n }\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements');\n }\n if (!(this._isWithContent() && this._isEnabled)) {\n return;\n }\n const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2));\n const shadowRoot = findShadowRoot(this._element);\n const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);\n if (showEvent.defaultPrevented || !isInTheDom) {\n return;\n }\n\n // TODO: v6 remove this or make it optional\n this._disposePopper();\n const tip = this._getTipElement();\n this._element.setAttribute('aria-describedby', tip.getAttribute('id'));\n const {\n container\n } = this._config;\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip);\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED));\n }\n this._popper = this._createPopper(tip);\n tip.classList.add(CLASS_NAME_SHOW$2);\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop);\n }\n }\n const complete = () => {\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2));\n if (this._isHovered === false) {\n this._leave();\n }\n this._isHovered = false;\n };\n this._queueCallback(complete, this.tip, this._isAnimated());\n }\n hide() {\n if (!this._isShown()) {\n return;\n }\n const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2));\n if (hideEvent.defaultPrevented) {\n return;\n }\n const tip = this._getTipElement();\n tip.classList.remove(CLASS_NAME_SHOW$2);\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop);\n }\n }\n this._activeTrigger[TRIGGER_CLICK] = false;\n this._activeTrigger[TRIGGER_FOCUS] = false;\n this._activeTrigger[TRIGGER_HOVER] = false;\n this._isHovered = null; // it is a trick to support manual triggering\n\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return;\n }\n if (!this._isHovered) {\n this._disposePopper();\n }\n this._element.removeAttribute('aria-describedby');\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2));\n };\n this._queueCallback(complete, this.tip, this._isAnimated());\n }\n update() {\n if (this._popper) {\n this._popper.update();\n }\n }\n\n // Protected\n _isWithContent() {\n return Boolean(this._getTitle());\n }\n _getTipElement() {\n if (!this.tip) {\n this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());\n }\n return this.tip;\n }\n _createTipElement(content) {\n const tip = this._getTemplateFactory(content).toHtml();\n\n // TODO: remove this check in v6\n if (!tip) {\n return null;\n }\n tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);\n // TODO: v6 the following can be achieved with CSS only\n tip.classList.add(`bs-${this.constructor.NAME}-auto`);\n const tipId = getUID(this.constructor.NAME).toString();\n tip.setAttribute('id', tipId);\n if (this._isAnimated()) {\n tip.classList.add(CLASS_NAME_FADE$2);\n }\n return tip;\n }\n setContent(content) {\n this._newContent = content;\n if (this._isShown()) {\n this._disposePopper();\n this.show();\n }\n }\n _getTemplateFactory(content) {\n if (this._templateFactory) {\n this._templateFactory.changeContent(content);\n } else {\n this._templateFactory = new TemplateFactory({\n ...this._config,\n // the `content` var has to be after `this._config`\n // to override config.content in case of popover\n content,\n extraClass: this._resolvePossibleFunction(this._config.customClass)\n });\n }\n return this._templateFactory;\n }\n _getContentForTemplate() {\n return {\n [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n };\n }\n _getTitle() {\n return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');\n }\n\n // Private\n _initializeOnDelegatedTarget(event) {\n return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());\n }\n _isAnimated() {\n return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2);\n }\n _isShown() {\n return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);\n }\n _createPopper(tip) {\n const placement = execute(this._config.placement, [this, tip, this._element]);\n const attachment = AttachmentMap[placement.toUpperCase()];\n return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));\n }\n _getOffset() {\n const {\n offset\n } = this._config;\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10));\n }\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element);\n }\n return offset;\n }\n _resolvePossibleFunction(arg) {\n return execute(arg, [this._element]);\n }\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [{\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n }, {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }, {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n }, {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n }, {\n name: 'preSetPlacement',\n enabled: true,\n phase: 'beforeMain',\n fn: data => {\n // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n this._getTipElement().setAttribute('data-popper-placement', data.state.placement);\n }\n }]\n };\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [defaultBsPopperConfig])\n };\n }\n _setListeners() {\n const triggers = this._config.trigger.split(' ');\n for (const trigger of triggers) {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context.toggle();\n });\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1);\n const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1);\n EventHandler.on(this._element, eventIn, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n context._enter();\n });\n EventHandler.on(this._element, eventOut, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event);\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);\n context._leave();\n });\n }\n }\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide();\n }\n };\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);\n }\n _fixTitle() {\n const title = this._element.getAttribute('title');\n if (!title) {\n return;\n }\n if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n this._element.setAttribute('aria-label', title);\n }\n this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility\n this._element.removeAttribute('title');\n }\n _enter() {\n if (this._isShown() || this._isHovered) {\n this._isHovered = true;\n return;\n }\n this._isHovered = true;\n this._setTimeout(() => {\n if (this._isHovered) {\n this.show();\n }\n }, this._config.delay.show);\n }\n _leave() {\n if (this._isWithActiveTrigger()) {\n return;\n }\n this._isHovered = false;\n this._setTimeout(() => {\n if (!this._isHovered) {\n this.hide();\n }\n }, this._config.delay.hide);\n }\n _setTimeout(handler, timeout) {\n clearTimeout(this._timeout);\n this._timeout = setTimeout(handler, timeout);\n }\n _isWithActiveTrigger() {\n return Object.values(this._activeTrigger).includes(true);\n }\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element);\n for (const dataAttribute of Object.keys(dataAttributes)) {\n if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n delete dataAttributes[dataAttribute];\n }\n }\n config = {\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n };\n config = this._mergeConfigObj(config);\n config = this._configAfterMerge(config);\n this._typeCheckConfig(config);\n return config;\n }\n _configAfterMerge(config) {\n config.container = config.container === false ? document.body : getElement(config.container);\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n return config;\n }\n _getDelegateConfig() {\n const config = {};\n for (const [key, value] of Object.entries(this._config)) {\n if (this.constructor.Default[key] !== value) {\n config[key] = value;\n }\n }\n config.selector = false;\n config.trigger = 'manual';\n\n // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n return config;\n }\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy();\n this._popper = null;\n }\n if (this.tip) {\n this.tip.remove();\n this.tip = null;\n }\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$3 = 'popover';\nconst SELECTOR_TITLE = '.popover-header';\nconst SELECTOR_CONTENT = '.popover-body';\nconst Default$2 = {\n ...Tooltip.Default,\n content: '',\n offset: [0, 8],\n placement: 'right',\n template: '
' + '
' + '

' + '
' + '
',\n trigger: 'click'\n};\nconst DefaultType$2 = {\n ...Tooltip.DefaultType,\n content: '(null|string|element|function)'\n};\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default$2;\n }\n static get DefaultType() {\n return DefaultType$2;\n }\n static get NAME() {\n return NAME$3;\n }\n\n // Overrides\n _isWithContent() {\n return this._getTitle() || this._getContent();\n }\n\n // Private\n _getContentForTemplate() {\n return {\n [SELECTOR_TITLE]: this._getTitle(),\n [SELECTOR_CONTENT]: this._getContent()\n };\n }\n _getContent() {\n return this._resolvePossibleFunction(this._config.content);\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config);\n if (typeof config !== 'string') {\n return;\n }\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n });\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover);\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n\n/**\n * Constants\n */\n\nconst NAME$2 = 'scrollspy';\nconst DATA_KEY$2 = 'bs.scrollspy';\nconst EVENT_KEY$2 = `.${DATA_KEY$2}`;\nconst DATA_API_KEY = '.data-api';\nconst EVENT_ACTIVATE = `activate${EVENT_KEY$2}`;\nconst EVENT_CLICK = `click${EVENT_KEY$2}`;\nconst EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`;\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\nconst CLASS_NAME_ACTIVE$1 = 'active';\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]';\nconst SELECTOR_TARGET_LINKS = '[href]';\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\nconst SELECTOR_NAV_LINKS = '.nav-link';\nconst SELECTOR_NAV_ITEMS = '.nav-item';\nconst SELECTOR_LIST_ITEMS = '.list-group-item';\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;\nconst SELECTOR_DROPDOWN = '.dropdown';\nconst SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';\nconst Default$1 = {\n offset: null,\n // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: '0px 0px -25%',\n smoothScroll: false,\n target: null,\n threshold: [0.1, 0.5, 1]\n};\nconst DefaultType$1 = {\n offset: '(number|null)',\n // TODO v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: 'string',\n smoothScroll: 'boolean',\n target: 'element',\n threshold: 'array'\n};\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element, config);\n\n // this._element is the observablesContainer and config.target the menu links wrapper\n this._targetLinks = new Map();\n this._observableSections = new Map();\n this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element;\n this._activeTarget = null;\n this._observer = null;\n this._previousScrollData = {\n visibleEntryTop: 0,\n parentScrollTop: 0\n };\n this.refresh(); // initialize\n }\n\n // Getters\n static get Default() {\n return Default$1;\n }\n static get DefaultType() {\n return DefaultType$1;\n }\n static get NAME() {\n return NAME$2;\n }\n\n // Public\n refresh() {\n this._initializeTargetsAndObservables();\n this._maybeEnableSmoothScroll();\n if (this._observer) {\n this._observer.disconnect();\n } else {\n this._observer = this._getNewObserver();\n }\n for (const section of this._observableSections.values()) {\n this._observer.observe(section);\n }\n }\n dispose() {\n this._observer.disconnect();\n super.dispose();\n }\n\n // Private\n _configAfterMerge(config) {\n // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n config.target = getElement(config.target) || document.body;\n\n // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;\n if (typeof config.threshold === 'string') {\n config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));\n }\n return config;\n }\n _maybeEnableSmoothScroll() {\n if (!this._config.smoothScroll) {\n return;\n }\n\n // unregister any previous listeners\n EventHandler.off(this._config.target, EVENT_CLICK);\n EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n const observableSection = this._observableSections.get(event.target.hash);\n if (observableSection) {\n event.preventDefault();\n const root = this._rootElement || window;\n const height = observableSection.offsetTop - this._element.offsetTop;\n if (root.scrollTo) {\n root.scrollTo({\n top: height,\n behavior: 'smooth'\n });\n return;\n }\n\n // Chrome 60 doesn't support `scrollTo`\n root.scrollTop = height;\n }\n });\n }\n _getNewObserver() {\n const options = {\n root: this._rootElement,\n threshold: this._config.threshold,\n rootMargin: this._config.rootMargin\n };\n return new IntersectionObserver(entries => this._observerCallback(entries), options);\n }\n\n // The logic of selection\n _observerCallback(entries) {\n const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`);\n const activate = entry => {\n this._previousScrollData.visibleEntryTop = entry.target.offsetTop;\n this._process(targetElement(entry));\n };\n const parentScrollTop = (this._rootElement || document.documentElement).scrollTop;\n const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop;\n this._previousScrollData.parentScrollTop = parentScrollTop;\n for (const entry of entries) {\n if (!entry.isIntersecting) {\n this._activeTarget = null;\n this._clearActiveClass(targetElement(entry));\n continue;\n }\n const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop;\n // if we are scrolling down, pick the bigger offsetTop\n if (userScrollsDown && entryIsLowerThanPrevious) {\n activate(entry);\n // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n if (!parentScrollTop) {\n return;\n }\n continue;\n }\n\n // if we are scrolling up, pick the smallest offsetTop\n if (!userScrollsDown && !entryIsLowerThanPrevious) {\n activate(entry);\n }\n }\n }\n _initializeTargetsAndObservables() {\n this._targetLinks = new Map();\n this._observableSections = new Map();\n const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target);\n for (const anchor of targetLinks) {\n // ensure that the anchor has an id and is not disabled\n if (!anchor.hash || isDisabled(anchor)) {\n continue;\n }\n const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);\n\n // ensure that the observableSection exists & is visible\n if (isVisible(observableSection)) {\n this._targetLinks.set(decodeURI(anchor.hash), anchor);\n this._observableSections.set(anchor.hash, observableSection);\n }\n }\n }\n _process(target) {\n if (this._activeTarget === target) {\n return;\n }\n this._clearActiveClass(this._config.target);\n this._activeTarget = target;\n target.classList.add(CLASS_NAME_ACTIVE$1);\n this._activateParents(target);\n EventHandler.trigger(this._element, EVENT_ACTIVATE, {\n relatedTarget: target\n });\n }\n _activateParents(target) {\n // Activate dropdown parents\n if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);\n return;\n }\n for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n // Set triggered links parents as active\n // With both