diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index dab5d2a..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,180 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# 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.
-#/
-
-# EditorConfig configuration file (see ).
-
-# Indicate that this file is a root-level configuration file:
-root = true
-
-# Set properties for all files:
-[*]
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-# Set properties for JavaScript files:
-[*.{js,js.txt}]
-indent_style = tab
-
-# Set properties for JavaScript ES module files:
-[*.{mjs,mjs.txt}]
-indent_style = tab
-
-# Set properties for JavaScript CommonJS files:
-[*.{cjs,cjs.txt}]
-indent_style = tab
-
-# Set properties for JSON files:
-[*.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `cli_opts.json` files:
-[cli_opts.json]
-indent_style = tab
-
-# Set properties for TypeScript files:
-[*.ts]
-indent_style = tab
-
-# Set properties for Python files:
-[*.{py,py.txt}]
-indent_style = space
-indent_size = 4
-
-# Set properties for Julia files:
-[*.{jl,jl.txt}]
-indent_style = tab
-
-# Set properties for R files:
-[*.{R,R.txt}]
-indent_style = tab
-
-# Set properties for C files:
-[*.{c,c.txt}]
-indent_style = tab
-
-# Set properties for C header files:
-[*.{h,h.txt}]
-indent_style = tab
-
-# Set properties for C++ files:
-[*.{cpp,cpp.txt}]
-indent_style = tab
-
-# Set properties for C++ header files:
-[*.{hpp,hpp.txt}]
-indent_style = tab
-
-# Set properties for Fortran files:
-[*.{f,f.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for shell files:
-[*.{sh,sh.txt}]
-indent_style = tab
-
-# Set properties for AWK files:
-[*.{awk,awk.txt}]
-indent_style = tab
-
-# Set properties for HTML files:
-[*.{html,html.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for XML files:
-[*.{xml,xml.txt}]
-indent_style = tab
-tab_width = 2
-
-# Set properties for CSS files:
-[*.{css,css.txt}]
-indent_style = tab
-
-# Set properties for Makefiles:
-[Makefile]
-indent_style = tab
-
-[*.{mk,mk.txt}]
-indent_style = tab
-
-# Set properties for Markdown files:
-[*.{md,md.txt}]
-indent_style = space
-indent_size = 4
-trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim.
-
-# Set properties for `usage.txt` files:
-[usage.txt]
-indent_style = space
-indent_size = 2
-
-# Set properties for `repl.txt` files:
-[repl.txt]
-indent_style = space
-indent_size = 4
-
-# Set properties for `package.json` files:
-[package.{json,json.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for `datapackage.json` files:
-[datapackage.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `manifest.json` files:
-[manifest.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for `tsconfig.json` files:
-[tsconfig.json]
-indent_style = space
-indent_size = 2
-
-# Set properties for LaTeX files:
-[*.{tex,tex.txt}]
-indent_style = tab
-
-# Set properties for LaTeX Bibliography files:
-[*.{bib,bib.txt}]
-indent_style = tab
-
-# Set properties for YAML files:
-[*.{yml,yml.txt}]
-indent_style = space
-indent_size = 2
-
-# Set properties for GYP files:
-[binding.gyp]
-indent_style = space
-indent_size = 2
-
-[*.gypi]
-indent_style = space
-indent_size = 2
-
-# Set properties for citation files:
-[*.{cff,cff.txt}]
-indent_style = space
-indent_size = 2
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 5f30286..0000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1 +0,0 @@
-/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 1c88e69..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,66 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2017 The Stdlib Authors.
-#
-# 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.
-#/
-
-# Configuration file which assigns attributes to pathnames.
-#
-# [1]: https://git-scm.com/docs/gitattributes
-
-# Automatically normalize the line endings of any committed text files:
-* text=auto
-
-# Override line endings for certain files on checkout:
-*.crlf.csv text eol=crlf
-
-# Denote that certain files are binary and should not be modified:
-*.png binary
-*.jpg binary
-*.jpeg binary
-*.gif binary
-*.ico binary
-*.gz binary
-*.zip binary
-*.7z binary
-*.mp3 binary
-*.mp4 binary
-*.mov binary
-
-# Override what is considered "vendored" by GitHub's linguist:
-/lib/node_modules/** -linguist-vendored -linguist-generated
-
-# Configure directories which should *not* be included in GitHub language statistics:
-/deps/** linguist-vendored
-/dist/** linguist-generated
-/workshops/** linguist-vendored
-
-benchmark/** linguist-vendored
-docs/* linguist-documentation
-etc/** linguist-vendored
-examples/** linguist-documentation
-scripts/** linguist-vendored
-test/** linguist-vendored
-tools/** linguist-vendored
-
-# Configure files which should *not* be included in GitHub language statistics:
-Makefile linguist-vendored
-*.mk linguist-vendored
-*.jl linguist-vendored
-*.py linguist-vendored
-*.R linguist-vendored
-
-# Configure files which should be included in GitHub language statistics:
-docs/types/*.d.ts -linguist-documentation
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index ddcb33a..0000000
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/array) of the main repository where we’ll review and provide feedback.
-
-If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib.
-
-We look forward to receiving your contribution! :smiley:
\ No newline at end of file
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
deleted file mode 100644
index e4f10fe..0000000
--- a/.github/workflows/benchmark.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# 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.
-#/
-
-# Workflow name:
-name: benchmark
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to run benchmarks:
- benchmark:
-
- # Define a display name:
- name: 'Run benchmarks'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Run benchmarks:
- - name: 'Run benchmarks'
- run: |
- npm run benchmark
diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml
deleted file mode 100644
index b5291db..0000000
--- a/.github/workflows/cancel.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# 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.
-#/
-
-# Workflow name:
-name: cancel
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to cancel existing workflow runs:
- cancel:
-
- # Define a display name:
- name: 'Cancel workflow runs'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Time limit:
- timeout-minutes: 3
-
- # Define the sequence of job steps...
- steps:
-
- # Cancel existing workflow runs:
- - name: 'Cancel existing workflow runs'
- # Pin action to full length commit SHA
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1
- with:
- workflow_id: >-
- benchmark.yml,
- examples.yml,
- test.yml,
- test_coverage.yml,
- test_install.yml,
- publish.yml
- access_token: ${{ github.token }}
diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml
deleted file mode 100644
index c9faa1b..0000000
--- a/.github/workflows/close_pull_requests.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# 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.
-#/
-
-# Workflow name:
-name: close_pull_requests
-
-# Workflow triggers:
-on:
- pull_request_target:
- types: [opened]
-
-# Workflow jobs:
-jobs:
-
- # Define job to close all pull requests:
- run:
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
-
- # Close pull request
- - name: 'Close pull request'
- # Pin action to full length commit SHA corresponding to v3.1.2
- uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448
- with:
- comment: |
- Thank you for submitting a pull request. :raised_hands:
-
- We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib).
-
- We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/array) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions.
-
- Thank you again, and we look forward to receiving your contribution! :smiley:
-
- Best,
- The stdlib team
\ No newline at end of file
diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml
deleted file mode 100644
index 2984901..0000000
--- a/.github/workflows/examples.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2021 The Stdlib Authors.
-#
-# 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.
-#/
-
-# Workflow name:
-name: examples
-
-# Workflow triggers:
-on:
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job to run the package examples...
- examples:
-
- # Define display name:
- name: 'Run examples'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Run examples:
- - name: 'Run examples'
- run: |
- npm run examples
diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml
deleted file mode 100644
index b7f0018..0000000
--- a/.github/workflows/npm_downloads.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2022 The Stdlib Authors.
-#
-# 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.
-#/
-
-# Workflow name:
-name: npm_downloads
-
-# Workflow triggers:
-on:
- # Run this workflow weekly:
- schedule:
- # cron: ' '
- - cron: '35 11 * * 6'
-
- # Allow the workflow to be manually run:
- workflow_dispatch:
-
-# Workflow jobs:
-jobs:
-
- # Define a job for retrieving npm download counts...
- npm_downloads:
-
- # Define display name:
- name: 'Retrieve npm download counts'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- timeout-minutes: 10
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Resolve package name:
- - name: 'Resolve package name'
- id: package_name
- run: |
- name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'`
- echo "package_name=$name" >> $GITHUB_OUTPUT
- timeout-minutes: 5
-
- # Fetch download data:
- - name: 'Fetch data'
- id: download_data
- run: |
- url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}"
- echo "$url"
- data=$(curl "$url")
- mkdir ./tmp
- echo "$data" > ./tmp/npm_downloads.json
- echo "data=$data" >> $GITHUB_OUTPUT
- timeout-minutes: 5
-
- # Print summary of download data:
- - name: 'Print summary'
- run: |
- echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY
- echo "|------|------------|" >> $GITHUB_STEP_SUMMARY
- cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY
-
- # Upload the download data:
- - name: 'Upload data'
- # Pin action to full length commit SHA
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
- with:
- # Define a name for the uploaded artifact (ensuring a unique name for each job):
- name: npm_downloads
-
- # Specify the path to the file to upload:
- path: ./tmp/npm_downloads.json
-
- # Specify the number of days to retain the artifact (default is 90 days):
- retention-days: 90
- timeout-minutes: 10
- if: success()
-
- # Send data to events server:
- - name: 'Post data'
- # Pin action to full length commit SHA
- uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3
- env:
- webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }}
- webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }}
- data: '{ "downloads": ${{ steps.download_data.outputs.data }} }'
- timeout-minutes: 5
- if: success()
diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml
deleted file mode 100644
index 83d50c4..0000000
--- a/.github/workflows/productionize.yml
+++ /dev/null
@@ -1,821 +0,0 @@
-#/
-# @license Apache-2.0
-#
-# Copyright (c) 2022 The Stdlib Authors.
-#
-# 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.
-#/
-
-# Workflow name:
-name: productionize
-
-# Workflow triggers:
-on:
- # Run workflow when a new commit is pushed to the main branch:
- push:
- branches:
- - main
-
- # Allow the workflow to be manually run:
- workflow_dispatch:
- inputs:
- require-passing-tests:
- description: 'Require passing tests for creating bundles'
- type: boolean
- default: true
-
- # Run workflow upon completion of `publish` workflow run:
- workflow_run:
- workflows: ["publish"]
- types: [completed]
-
-
-# Concurrency group to prevent multiple concurrent executions:
-concurrency:
- group: productionize
- cancel-in-progress: true
-
-# Workflow jobs:
-jobs:
-
- # Define a job to create a production build...
- productionize:
-
- # Define display name:
- name: 'Productionize'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Define the sequence of job steps...
- steps:
- # Checkout main branch of repository:
- - name: 'Checkout main branch'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- with:
- ref: main
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Create production branch:
- - name: 'Create production branch'
- run: |
- git checkout -b production
-
- # Transform error messages:
- - name: 'Transform error messages'
- id: transform-error-messages
- uses: stdlib-js/transform-errors-action@main
-
- # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency:
- - name: 'Update dependencies in package.json'
- run: |
- PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version)
- if grep -q '"@stdlib/string-format"' package.json; then
- sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json
- else
- node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );"
- fi
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Commit changes:
- - name: 'Commit changes'
- run: |
- git add -A
- git commit -m "Transform error messages"
-
- # Push changes:
- - name: 'Push changes'
- run: |
- SLUG=${{ github.repository }}
- echo "Pushing changes to $SLUG..."
- git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force
-
- # Define a job for running tests of the productionized code...
- test:
-
- # Define a display name:
- name: 'Run Tests'
-
- # Define the type of virtual host machine:
- runs-on: 'ubuntu-latest'
-
- # Indicate that this job depends on the prior job finishing:
- needs: productionize
-
- # Run this job regardless of the outcome of the prior job:
- if: always()
-
- # Define the sequence of job steps...
- steps:
-
- # Checkout the repository:
- - name: 'Checkout repository'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- with:
- # Use the `production` branch:
- ref: production
-
- # Install Node.js:
- - name: 'Install Node.js'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Build native add-on if present:
- - name: 'Build native add-on (if present)'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- run: |
- if [ -f "binding.gyp" ]; then
- npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild
- fi
-
- # Run tests:
- - name: 'Run tests'
- if: ${{ github.event.inputs.require-passing-tests == 'true' }}
- id: tests
- run: |
- npm test || npm test || npm test
-
- # Define job to create a bundle for use in Deno...
- deno:
-
- # Define display name:
- name: 'Create Deno bundle'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Indicate that this job depends on the test job finishing:
- needs: test
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Check if remote `deno` branch exists:
- - name: 'Check if remote `deno` branch exists'
- id: deno-branch-exists
- continue-on-error: true
- run: |
- git fetch --all
- git ls-remote --exit-code --heads origin deno
- if [ $? -eq 0 ]; then
- echo "remote-exists=true" >> $GITHUB_OUTPUT
- else
- echo "remote-exists=false" >> $GITHUB_OUTPUT
- fi
-
- # If `deno` exists, delete everything in branch and merge `production` into it
- - name: 'If `deno` exists, delete everything in branch and merge `production` into it'
- if: steps.deno-branch-exists.outputs.remote-exists
- run: |
- git checkout -b deno origin/deno
-
- find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf
-
- git add -A
- git commit -m "Remove files" --allow-empty
-
- git config merge.theirs.name 'simulate `-s theirs`'
- git config merge.theirs.driver 'cat %B > %A'
- GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories
-
- # Copy files from `production` branch if necessary:
- git checkout origin/production -- .
- if [ -n "$(git status --porcelain)" ]; then
- git add -A
- git commit -m "Auto-generated commit"
- fi
-
- # If `deno` does not exist, create `deno` branch:
- - name: 'If `deno` does not exist, create `deno` branch'
- if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }}
- run: |
- git checkout production
- git checkout -b deno
-
- # Copy files to deno directory:
- - name: 'Copy files to deno directory'
- run: |
- mkdir -p deno
- cp README.md LICENSE CONTRIBUTORS NOTICE ./deno
-
- # Copy TypeScript definitions to deno directory:
- if [ -d index.d.ts ]; then
- cp index.d.ts ./deno/index.d.ts
- fi
- if [ -e ./docs/types/index.d.ts ]; then
- cp ./docs/types/index.d.ts ./deno/mod.d.ts
- fi
-
- # Install Node.js:
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: Install production and development dependencies
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Bundle package for use in Deno:
- - name: 'Bundle package for Deno'
- id: deno-bundle
- uses: stdlib-js/bundle-action@main
- with:
- target: 'deno'
-
- # Rewrite file contents:
- - name: 'Rewrite file contents'
- run: |
- # Replace links to other packages with links to the deno branch:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/";
-
- # Replace reference to `@stdlib/types` with CDN link:
- find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g"
-
- # Change wording of project description to avoid reference to JavaScript and Node.js:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g"
-
- # Rewrite all `require()`s to use jsDelivr links:
- find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// {
- s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i
- s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/
- s/';/@deno\/mod.js';/
- }"
-
- # Rewrite first `import` to show importing of named exports if available:
- exports=$(cat lib/index.js | \
- grep -E 'setReadOnly\(.*,.*,.*\)' | \
- sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \
- sed -E "s/'//g" | \
- sort)
- if [ -n "$exports" ]; then
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/"
- fi
-
- # Remove `installation`, `cli`, and `c` sections:
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/[^<]+<\/section>//g;"
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.cli \-\->//g"
- find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.c \-\->//g"
-
- # Create package.json file for deno branch:
- jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json
-
- # Delete everything in current directory aside from deno folder:
- - name: 'Delete everything in current directory aside from deno folder'
- run: |
- find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf
-
- # Move deno directory to root:
- - name: 'Move deno directory to root'
- run: |
- mv ./deno/* .
- rmdir ./deno
-
- # Commit changes:
- - name: 'Commit changes'
- run: |
- git add -A
- git commit -m "Auto-generated commit"
-
- # Push changes to `deno` branch:
- - name: 'Push changes to `deno` branch'
- run: |
- SLUG=${{ github.repository }}
- echo "Pushing changes to $SLUG..."
- git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno
-
- # Send notification to Zulip if job fails:
- - name: 'Send notification to Zulip in case of failure'
- # Pin action to full length commit SHA
- uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
- if: failure()
- with:
- api-key: ${{ secrets.ZULIP_API_KEY }}
- email: 'github-actions-bot@stdlib.zulipchat.com'
- organization-url: 'https://stdlib.zulipchat.com'
- to: 'workflows-standalone'
- type: 'stream'
- topic: ${{ github.event.repository.name }}
- content: |
- :cross_mark: **${{ github.workflow }}** workflow failed
-
- **Repository:** [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }})
- **Run:** [View workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
-
- # Define job to create a UMD bundle...
- umd:
-
- # Define display name:
- name: 'Create UMD bundle'
-
- # Define the type of virtual host machine on which to run the job:
- runs-on: ubuntu-latest
-
- # Indicate that this job depends on the test job finishing:
- needs: test
-
- # Define the sequence of job steps...
- steps:
- # Checkout the repository:
- - name: 'Checkout repository'
- # Pin action to full length commit SHA
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
-
- # Configure Git:
- - name: 'Configure Git'
- run: |
- git config --local user.email "noreply@stdlib.io"
- git config --local user.name "stdlib-bot"
-
- # Check if remote `umd` branch exists:
- - name: 'Check if remote `umd` branch exists'
- id: umd-branch-exists
- continue-on-error: true
- run: |
- git fetch --all
- git ls-remote --exit-code --heads origin umd
- if [ $? -eq 0 ]; then
- echo "remote-exists=true" >> $GITHUB_OUTPUT
- else
- echo "remote-exists=false" >> $GITHUB_OUTPUT
- fi
-
- # If `umd` exists, delete everything in branch and merge `production` into it
- - name: 'If `umd` exists, delete everything in branch and merge `production` into it'
- if: steps.umd-branch-exists.outputs.remote-exists
- run: |
- git checkout -b umd origin/umd
-
- find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm
- find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf
-
- git add -A
- git commit -m "Remove files" --allow-empty
-
- git config merge.theirs.name 'simulate `-s theirs`'
- git config merge.theirs.driver 'cat %B > %A'
- GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories
-
- # Copy files from `production` branch if necessary:
- git checkout origin/production -- .
- if [ -n "$(git status --porcelain)" ]; then
- git add -A
- git commit -m "Auto-generated commit"
- fi
-
- # If `umd` does not exist, create `umd` branch:
- - name: 'If `umd` does not exist, create `umd` branch'
- if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }}
- run: |
- git checkout production
- git checkout -b umd
-
- # Copy files to umd directory:
- - name: 'Copy files to umd directory'
- run: |
- mkdir -p umd
- cp README.md LICENSE CONTRIBUTORS NOTICE ./umd
-
- # Install Node.js
- - name: 'Install Node.js'
- # Pin action to full length commit SHA
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- with:
- node-version: 20
- timeout-minutes: 5
-
- # Install dependencies:
- - name: 'Install production and development dependencies'
- id: install
- run: |
- npm install || npm install || npm install
- timeout-minutes: 15
-
- # Extract alias:
- - name: 'Extract alias'
- id: extract-alias
- run: |
- alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/')
- echo "alias=${alias}" >> $GITHUB_OUTPUT
-
- # Create Universal Module Definition (UMD) Node.js bundle:
- - name: 'Create Universal Module Definition (UMD) Node.js bundle'
- id: umd-bundle-node
- uses: stdlib-js/bundle-action@main
- with:
- target: 'umd-node'
- alias: ${{ steps.extract-alias.outputs.alias }}
-
- # Create Universal Module Definition (UMD) browser bundle:
- - name: 'Create Universal Module Definition (UMD) browser bundle'
- id: umd-bundle-browser
- uses: stdlib-js/bundle-action@main
- with:
- target: 'umd-browser'
- alias: ${{ steps.extract-alias.outputs.alias }}
-
- # Rewrite file contents:
- - name: 'Rewrite file contents'
- run: |
-
- # Replace links to other packages with links to the umd branch:
- find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/";
-
- # Remove `installation`, `cli`, and `c` sections:
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/[^<]+<\/section>//g;"
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.cli \-\->//g"
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?[\s\S]+<\!\-\- \/.c \-\->//g"
-
- # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag:
- find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n
+```
-```javascript
-var array = require( '@stdlib/ndarray-array' );
+If no recognized module system is present, access bundle contents via the global scope:
+
+```html
+
```
@@ -239,8 +245,13 @@ var bool = ( v === buf[ 0 ] );
-```javascript
-var array = require( '@stdlib/ndarray-array' );
+```html
+
+
+
+
+
+
+
```
@@ -366,17 +382,17 @@ Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/ndarray-array/main/LICENSE
-[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray-dtypes
+[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray-dtypes/tree/umd
-[@stdlib/array/generic]: https://github.com/stdlib-js/array-generic
+[@stdlib/array/generic]: https://github.com/stdlib-js/array-generic/tree/umd
-[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed
+[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/umd
-[@stdlib/buffer/ctor]: https://github.com/stdlib-js/buffer-ctor
+[@stdlib/buffer/ctor]: https://github.com/stdlib-js/buffer-ctor/tree/umd
-[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/ndarray-ctor
+[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/ndarray-ctor/tree/umd
diff --git a/SECURITY.md b/SECURITY.md
deleted file mode 100644
index 9702d4c..0000000
--- a/SECURITY.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Security
-
-> Policy for reporting security vulnerabilities.
-
-See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js
deleted file mode 100644
index 328e99f..0000000
--- a/benchmark/benchmark.js
+++ /dev/null
@@ -1,1210 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2018 The Stdlib Authors.
-*
-* 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.
-*/
-
-'use strict';
-
-// MODULES //
-
-var bench = require( '@stdlib/bench-harness' );
-var Float32Array = require( '@stdlib/array-float32' );
-var isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );
-var format = require( '@stdlib/string-format' );
-var pkg = require( './../package.json' ).name;
-var array = require( './../lib' );
-
-
-// MAIN //
-
-bench( format( '%s::1d,instantiation,linear_buffer', pkg ), function benchmark( b ) {
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation,shape', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var i;
-
- opts = {
- 'shape': [ 6 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation,ndarray', pkg ), function benchmark( b ) {
- var out;
- var arr;
- var i;
-
- arr = array( new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ) );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation,no_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float32'
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation,default_cast', pkg ), function benchmark( b ) {
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation,dtype_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float64'
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation:copy=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': false
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation:copy=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': true
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation:dtype=generic', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic'
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation:dtype=generic,flatten=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'flatten': true
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::1d,instantiation:dtype=generic,flatten=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'flatten': false
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation,linear_buffer', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation,shape', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var i;
-
- opts = {
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation,ndarray', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'shape': [ 3, 2 ]
- };
- arr = array( arr, opts );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation,no_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float32',
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation,default_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation,dtype_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float64',
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation:copy=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': false,
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation:copy=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': true,
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation:dtype=generic', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation:dtype=generic,flatten=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ];
- opts = {
- 'dtype': 'generic',
- 'flatten': true
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::2d,instantiation:dtype=generic,flatten=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'flatten': false,
- 'shape': [ 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation,linear_buffer', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation,shape', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var i;
-
- opts = {
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation,ndarray', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'shape': [ 1, 3, 2 ]
- };
- arr = array( arr, opts );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation,no_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float32',
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation,default_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation,dtype_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float64',
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation:copy=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': false,
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation:copy=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': true,
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation:dtype=generic', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation:dtype=generic,flatten=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] ];
- opts = {
- 'dtype': 'generic',
- 'flatten': true
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::3d,instantiation:dtype=generic,flatten=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'flatten': false,
- 'shape': [ 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation,linear_buffer', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation,shape', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var i;
-
- opts = {
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation,ndarray', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'shape': [ 1, 1, 3, 2 ]
- };
- arr = array( arr, opts );
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation,no_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float32',
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation,default_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation,dtype_cast', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'dtype': 'float64',
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation:copy=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': false,
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation:copy=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'copy': true,
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation:dtype=generic', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation:dtype=generic,flatten=true', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ] ] ];
- opts = {
- 'dtype': 'generic',
- 'flatten': true
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::4d,instantiation:dtype=generic,flatten=false', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
- opts = {
- 'dtype': 'generic',
- 'flatten': false,
- 'shape': [ 1, 1, 3, 2 ]
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
-
-bench( format( '%s::5d,instantiation:ndmin=5', pkg ), function benchmark( b ) {
- var opts;
- var out;
- var arr;
- var i;
-
- arr = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
- opts = {
- 'ndmin': 5
- };
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = array( arr, opts );
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an object' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
-});
diff --git a/benchmark/python/numpy/benchmark.py b/benchmark/python/numpy/benchmark.py
deleted file mode 100644
index 2a561ce..0000000
--- a/benchmark/python/numpy/benchmark.py
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/usr/bin/env python
-#
-# @license Apache-2.0
-#
-# Copyright (c) 2018 The Stdlib Authors.
-#
-# 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.
-
-"""Benchmark numpy.array."""
-
-from __future__ import print_function
-import timeit
-
-REPEATS = 3
-COUNT = [0] # use a list to allow modification within nested scopes
-
-
-def print_version():
- """Print the TAP version."""
- print("TAP version 13")
-
-
-def print_summary(total, passing):
- """Print the benchmark summary.
-
- # Arguments
-
- * `total`: total number of tests
- * `passing`: number of passing tests
-
- """
- print("#")
- print("1.." + str(total)) # TAP plan
- print("# total " + str(total))
- print("# pass " + str(passing))
- print("#")
- print("# ok")
-
-
-def print_results(iterations, elapsed):
- """Print benchmark results.
-
- # Arguments
-
- * `iterations`: number of iterations
- * `elapsed`: elapsed time (in seconds)
-
- # Examples
-
- ``` python
- python> print_results(100000, 0.131009101868)
- ```
- """
- rate = iterations / elapsed
-
- print(" ---")
- print(" iterations: " + str(iterations))
- print(" elapsed: " + str(elapsed))
- print(" rate: " + str(rate))
- print(" ...")
-
-
-def benchmark(name, setup, stmt, iterations):
- """Run a benchmark and print benchmark results.
-
- # Arguments
-
- * `name`: benchmark name (suffix)
- * `setup`: benchmark setup
- * `stmt`: statement to benchmark
- * `iterations`: number of iterations
-
- # Examples
-
- ``` python
- python> benchmark("::random", "from random import random;", "y = random()", 1000000)
- ```
- """
- t = timeit.Timer(stmt, setup=setup)
-
- i = 0
- while i < REPEATS:
- print("# python::numpy" + name)
- COUNT[0] += 1
- elapsed = t.timeit(number=iterations)
- print_results(iterations, elapsed)
- print("ok " + str(COUNT[0]) + " benchmark finished")
- i += 1
-
-
-def main():
- """Run the benchmarks."""
- # pylint: disable=too-many-statements
- print_version()
-
- name = "::1d,instantiation,linear_buffer"
- setup = "import numpy as np; x = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0];"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::1d,instantiation,ndarray"
- setup = "import numpy as np; x = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::1d,instantiation,no_cast"
- setup = "import numpy as np; x = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::1d,instantiation,default_cast"
- setup = "import numpy as np; x = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0];"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::1d,instantiation,dtype_cast"
- setup = "import numpy as np; x = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], dtype='float32');"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::1d,instantiation:copy=false"
- setup = "import numpy as np; x = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);"
- stmt = "y = np.array(x, copy=False)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::1d,instantiation:copy=true"
- setup = "import numpy as np; x = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);"
- stmt = "y = np.array(x, copy=True)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::2d,instantiation,ndarray"
- setup = "import numpy as np; x = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]);"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::2d,instantiation,no_cast"
- setup = "import numpy as np; x = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype='float64');"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::2d,instantiation,default_cast"
- setup = "import numpy as np; x = [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]];"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::2d,instantiation,dtype_cast"
- setup = "import numpy as np; x = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], dtype='float32');"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::2d,instantiation:copy=false"
- setup = "import numpy as np; x = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]);"
- stmt = "y = np.array(x, copy=False)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::2d,instantiation:copy=true"
- setup = "import numpy as np; x = np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]);"
- stmt = "y = np.array(x, copy=True)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::2d,instantiation:flatten=true"
- setup = "import numpy as np; x = [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]];"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::3d,instantiation,ndarray"
- setup = "import numpy as np; x = np.array([[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]);"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::3d,instantiation,no_cast"
- setup = "import numpy as np; x = np.array([[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]], dtype='float64');"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::3d,instantiation,default_cast"
- setup = "import numpy as np; x = [[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]];"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::3d,instantiation,dtype_cast"
- setup = "import numpy as np; x = np.array([[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]], dtype='float32');"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::3d,instantiation:copy=false"
- setup = "import numpy as np; x = np.array([[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]);"
- stmt = "y = np.array(x, copy=False)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::3d,instantiation:copy=true"
- setup = "import numpy as np; x = np.array([[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]);"
- stmt = "y = np.array(x, copy=True)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::3d,instantiation:flatten=true"
- setup = "import numpy as np; x = [[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]];"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::4d,instantiation,ndarray"
- setup = "import numpy as np; x = np.array([[[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]]);"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::4d,instantiation,no_cast"
- setup = "import numpy as np; x = np.array([[[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]], dtype='float64');"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::4d,instantiation,default_cast"
- setup = "import numpy as np; x = [[[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]];"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::4d,instantiation,dtype_cast"
- setup = "import numpy as np; x = np.array([[[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]], dtype='float32');"
- stmt = "y = np.array(x, dtype='float64')"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::4d,instantiation:copy=false"
- setup = "import numpy as np; x = np.array([[[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]]);"
- stmt = "y = np.array(x, copy=False)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::4d,instantiation:copy=true"
- setup = "import numpy as np; x = np.array([[[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]]);"
- stmt = "y = np.array(x, copy=True)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::4d,instantiation:flatten=true"
- setup = "import numpy as np; x = [[[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]]];"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- name = "::5d,instantiation:ndmin=5"
- setup = "import numpy as np; x = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0];"
- stmt = "y = np.array(x)"
- iterations = 100000
- benchmark(name, setup, stmt, iterations)
-
- print_summary(COUNT[0], COUNT[0])
-
-
-if __name__ == "__main__":
- main()
diff --git a/branches.md b/branches.md
deleted file mode 100644
index 10cb019..0000000
--- a/branches.md
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-# Branches
-
-This repository has the following branches:
-
-- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place.
-- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network).
-- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]).
-- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]).
-- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]).
-
-The following diagram illustrates the relationships among the above branches:
-
-```mermaid
-graph TD;
-A[stdlib]-->|generate standalone package|B;
-B[main] -->|productionize| C[production];
-C -->|bundle| D[esm];
-C -->|bundle| E[deno];
-C -->|bundle| F[umd];
-
-%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/array"
-%% click B href "https://github.com/stdlib-js/ndarray-array/tree/main"
-%% click C href "https://github.com/stdlib-js/ndarray-array/tree/production"
-%% click D href "https://github.com/stdlib-js/ndarray-array/tree/esm"
-%% click E href "https://github.com/stdlib-js/ndarray-array/tree/deno"
-%% click F href "https://github.com/stdlib-js/ndarray-array/tree/umd"
-```
-
-[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/array
-[production-url]: https://github.com/stdlib-js/ndarray-array/tree/production
-[deno-url]: https://github.com/stdlib-js/ndarray-array/tree/deno
-[deno-readme]: https://github.com/stdlib-js/ndarray-array/blob/deno/README.md
-[umd-url]: https://github.com/stdlib-js/ndarray-array/tree/umd
-[umd-readme]: https://github.com/stdlib-js/ndarray-array/blob/umd/README.md
-[esm-url]: https://github.com/stdlib-js/ndarray-array/tree/esm
-[esm-readme]: https://github.com/stdlib-js/ndarray-array/blob/esm/README.md
\ No newline at end of file
diff --git a/browser.js b/browser.js
new file mode 100644
index 0000000..b0cab72
--- /dev/null
+++ b/browser.js
@@ -0,0 +1,3 @@
+// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).array=e()}(this,(function(){"use strict";var t=Object.prototype.hasOwnProperty;function e(e,r){return null!=e&&t.call(e,r)}var r="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function n(){return r&&"symbol"==typeof Symbol.toStringTag}var i=Object.prototype.toString;var o="function"==typeof Symbol?Symbol:void 0,a="function"==typeof o?o.toStringTag:"";var u=n()?function(t){var r,n,o;if(null==t)return i.call(t);n=t[a],r=e(t,a);try{t[a]=void 0}catch(e){return i.call(t)}return o=i.call(t),r?t[a]=n:delete t[a],o}:function(t){return i.call(t)};var f=Array.isArray?Array.isArray:function(t){return"[object Array]"===u(t)};function s(t){return"object"==typeof t&&null!==t&&!f(t)}var l=/./,c="function"==typeof Object.defineProperty?Object.defineProperty:null;var h=Object.defineProperty;function p(t){return"number"==typeof t}function g(t){var e,r="";for(e=0;e0&&(r-=1),n=t.toExponential(r)):n=t.toPrecision(e.precision),e.alternate||(n=E.call(n,j,"$1e"),n=E.call(n,S,"e"),n=E.call(n,V,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return n=E.call(n,x,"e+0$1"),n=E.call(n,T,"e-0$1"),e.alternate&&(n=E.call(n,A,"$1."),n=E.call(n,O,"$1.e")),t>=0&&e.sign&&(n=e.sign+n),n=e.specifier===_.call(e.specifier)?_.call(n):w.call(n)}function L(t){var e,r="";for(e=0;e127)throw new Error("invalid character code. Value: "+n.arg);n.arg=F(o)?String(n.arg):I(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(e||(n.precision=6),f=parseFloat(n.arg),!isFinite(f)){if(!p(n.arg))throw new Error("invalid floating-point number. Value: "+a);f=n.arg,n.padZeros=!1}n.arg=R(f,n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=y(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(c=n.arg,h=n.width,g=n.padRight,m=void 0,(m=h-c.length)<0?c:c=g?c+L(m):L(m)+c)),a+=n.arg||"",u+=1}return a}var M=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function k(t){var e={mapping:t[1]?parseInt(t[1],10):void 0,flags:t[2],width:t[3],precision:t[5],specifier:t[6]};return"."===t[4]&&void 0===t[5]&&(e.precision="1"),e}function C(t){var e,r,n,i;for(r=[],i=0,n=M.exec(t);n;)(e=t.slice(i,M.lastIndex-n[0].length)).length&&r.push(e),"%"===n[6]?r.push("%"):r.push(k(n)),i=M.lastIndex,n=M.exec(t);return(e=t.slice(i)).length&&r.push(e),r}function N(t){var e,r;if("string"!=typeof t)throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t));for(e=[C(t)],r=1;rLt&&Bt(t)}function Pt(t){return Tt(t)&&Ft(t)}function Ut(t){return St(t)&&Ft(t.valueOf())}function Mt(t){return Pt(t)||Ut(t)}function kt(t){return Pt(t)&&t>=0}function Ct(t){return Ut(t)&&t.valueOf()>=0}function Nt(t){return kt(t)||Ct(t)}q(Mt,"isPrimitive",Pt),q(Mt,"isObject",Ut),q(Nt,"isPrimitive",kt),q(Nt,"isObject",Ct);var Yt=ot();function Dt(){return"function"==typeof Yt.BigInt&&"function"==typeof BigInt&&"bigint"==typeof Yt.BigInt("1")&&"bigint"==typeof BigInt("1")}function zt(t,e,r){Z(t,e,{configurable:!1,enumerable:!1,get:r})}function Jt(t){return"string"==typeof t}var Wt=String.prototype.valueOf;var $t=n();function Gt(t){return"object"==typeof t&&(t instanceof String||($t?function(t){try{return Wt.call(t),!0}catch(t){return!1}}(t):"[object String]"===u(t)))}function Zt(t){return Jt(t)||Gt(t)}function qt(t){return Pt(t)&&t>0}function Xt(t){return Ut(t)&&t.valueOf()>0}function Kt(t){return qt(t)||Xt(t)}function Ht(t){return Object.keys(Object(t))}q(Zt,"isPrimitive",Jt),q(Zt,"isObject",Gt),q(Kt,"isPrimitive",qt),q(Kt,"isObject",Xt);var Qt,te=void 0!==Object.keys;function ee(t){return"[object Arguments]"===u(t)}Qt=function(){return ee(arguments)}();var re=Qt;function ne(t){return t!=t}function ie(t){return Tt(t)&&ne(t)}function oe(t){return St(t)&&ne(t.valueOf())}function ae(t){return ie(t)||oe(t)}q(ae,"isPrimitive",ie),q(ae,"isObject",oe);var ue=Object.prototype.propertyIsEnumerable;var fe=!ue.call("beep","0");function se(t,e){var r;return null!=t&&(!(r=ue.call(t,e))&&fe&&Zt(t)?!ie(e=+e)&&Pt(e)&&e>=0&&e=0&&t.length<=le&&e(t,"callee")&&!se(t,"callee")},he=Array.prototype.slice;var pe=se((function(){}),"prototype"),ge=!se({toString:null},"toString"),ye=9007199254740991;function me(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&Bt(t.length)&&t.length>=0&&t.length<=ye}function de(t,e,r){var n,i;if(!me(t)&&!Jt(t))throw new TypeError(N("invalid argument. First argument must be an array-like object. Value: `%s`.",t));if(0===(n=t.length))return-1;if(3===arguments.length){if(!Pt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));if(r>=0){if(r>=n)return-1;i=r}else(i=n+r)<0&&(i=0)}else i=0;if(ae(e)){for(;i0&&!e(t,"0"))for(f=0;f1){if(!xt(r))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e(r,"duplicates")&&!X(c=r.duplicates))throw new TypeError(N("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",c))}if(i=(n=Ae(t)).length,u={},c)for(l=0;li&&(n=!1),!n&&!e)return 0;i=o}return n&&e?3:n?1:2}var Be="function";function Fe(t){return typeof t.get===Be&&typeof t.set===Be}var Pe={float64:function(t,e){return t[e]},float32:function(t,e){return t[e]},int32:function(t,e){return t[e]},int16:function(t,e){return t[e]},int8:function(t,e){return t[e]},uint32:function(t,e){return t[e]},uint16:function(t,e){return t[e]},uint8:function(t,e){return t[e]},uint8c:function(t,e){return t[e]},generic:function(t,e){return t[e]},default:function(t,e){return t[e]}};function Ue(t){var e=Pe[t];return"function"==typeof e?e:Pe.default}var Me={float64:function(t,e,r){t[e]=r},float32:function(t,e,r){t[e]=r},int32:function(t,e,r){t[e]=r},int16:function(t,e,r){t[e]=r},int8:function(t,e,r){t[e]=r},uint32:function(t,e,r){t[e]=r},uint16:function(t,e,r){t[e]=r},uint8:function(t,e,r){t[e]=r},uint8c:function(t,e,r){t[e]=r},generic:function(t,e,r){t[e]=r},default:function(t,e,r){t[e]=r}};function ke(t){var e=Me[t];return"function"==typeof e?e:Me.default}var Ce={complex128:function(t,e){return t.get(e)},complex64:function(t,e){return t.get(e)},default:function(t,e){return t.get(e)}};function Ne(t){var e=Ce[t];return"function"==typeof e?e:Ce.default}var Ye={complex128:function(t,e,r){t.set(r,e)},complex64:function(t,e,r){t.set(r,e)},default:function(t,e,r){t.set(r,e)}};function De(t){var e=Ye[t];return"function"==typeof e?e:Ye.default}var ze={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"},Je="function"==typeof Float64Array;var We="function"==typeof Float64Array?Float64Array:null;function $e(){var t,e,r;if("function"!=typeof We)return!1;try{e=new We([1,3.14,-3.14,NaN]),r=e,t=(Je&&r instanceof Float64Array||"[object Float64Array]"===u(r))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){t=!1}return t}var Ge="function"==typeof Float64Array?Float64Array:void 0;var Ze=$e()?Ge:function(){throw new Error("not implemented")},qe="function"==typeof Float32Array;var Xe="function"==typeof Float32Array?Float32Array:null;var Ke,He="function"==typeof Float32Array?Float32Array:void 0;Ke=function(){var t,e,r;if("function"!=typeof Xe)return!1;try{e=new Xe([1,3.14,-3.14,5e40]),r=e,t=(qe&&r instanceof Float32Array||"[object Float32Array]"===u(r))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===Rt}catch(e){t=!1}return t}()?He:function(){throw new Error("not implemented")};var Qe=Ke,tr="function"==typeof Uint32Array;var er="function"==typeof Uint32Array?Uint32Array:null;var rr,nr="function"==typeof Uint32Array?Uint32Array:void 0;rr=function(){var t,e,r;if("function"!=typeof er)return!1;try{e=new er(e=[1,3.14,-3.14,le+1,le+2]),r=e,t=(tr&&r instanceof Uint32Array||"[object Uint32Array]"===u(r))&&1===e[0]&&3===e[1]&&e[2]===le-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?nr:function(){throw new Error("not implemented")};var ir=rr,or="function"==typeof Int32Array;var ar=2147483647,ur=-2147483648,fr="function"==typeof Int32Array?Int32Array:null;var sr,lr="function"==typeof Int32Array?Int32Array:void 0;sr=function(){var t,e,r;if("function"!=typeof fr)return!1;try{e=new fr([1,3.14,-3.14,ar+1]),r=e,t=(or&&r instanceof Int32Array||"[object Int32Array]"===u(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===ur}catch(e){t=!1}return t}()?lr:function(){throw new Error("not implemented")};var cr=sr,hr="function"==typeof Uint16Array;var pr=65535,gr="function"==typeof Uint16Array?Uint16Array:null;var yr,mr="function"==typeof Uint16Array?Uint16Array:void 0;yr=function(){var t,e,r;if("function"!=typeof gr)return!1;try{e=new gr(e=[1,3.14,-3.14,pr+1,pr+2]),r=e,t=(hr&&r instanceof Uint16Array||"[object Uint16Array]"===u(r))&&1===e[0]&&3===e[1]&&e[2]===pr-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?mr:function(){throw new Error("not implemented")};var dr=yr,vr="function"==typeof Int16Array;var br=32767,wr=-32768,_r="function"==typeof Int16Array?Int16Array:null;var Er,xr="function"==typeof Int16Array?Int16Array:void 0;Er=function(){var t,e,r;if("function"!=typeof _r)return!1;try{e=new _r([1,3.14,-3.14,br+1]),r=e,t=(vr&&r instanceof Int16Array||"[object Int16Array]"===u(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===wr}catch(e){t=!1}return t}()?xr:function(){throw new Error("not implemented")};var Tr=Er,Ar="function"==typeof Uint8Array;var Or=255,Vr="function"==typeof Uint8Array?Uint8Array:null;var Sr,jr="function"==typeof Uint8Array?Uint8Array:void 0;Sr=function(){var t,e,r;if("function"!=typeof Vr)return!1;try{e=new Vr(e=[1,3.14,-3.14,Or+1,Or+2]),r=e,t=(Ar&&r instanceof Uint8Array||"[object Uint8Array]"===u(r))&&1===e[0]&&3===e[1]&&e[2]===Or-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}()?jr:function(){throw new Error("not implemented")};var Rr=Sr,Lr="function"==typeof Uint8ClampedArray;var Ir="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var Br,Fr="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;Br=function(){var t,e,r;if("function"!=typeof Ir)return!1;try{e=new Ir([-1,0,1,3.14,4.99,255,256]),r=e,t=(Lr&&r instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===u(r))&&0===e[0]&&0===e[1]&&1===e[2]&&3===e[3]&&5===e[4]&&255===e[5]&&255===e[6]}catch(e){t=!1}return t}()?Fr:function(){throw new Error("not implemented")};var Pr=Br,Ur="function"==typeof Int8Array;var Mr=127,kr=-128,Cr="function"==typeof Int8Array?Int8Array:null;var Nr,Yr="function"==typeof Int8Array?Int8Array:void 0;Nr=function(){var t,e,r;if("function"!=typeof Cr)return!1;try{e=new Cr([1,3.14,-3.14,Mr+1]),r=e,t=(Ur&&r instanceof Int8Array||"[object Int8Array]"===u(r))&&1===e[0]&&3===e[1]&&-3===e[2]&&e[3]===kr}catch(e){t=!1}return t}()?Yr:function(){throw new Error("not implemented")};var Dr=Nr,zr=4294967295;function Jr(t){return"object"==typeof t&&null!==t&&"number"==typeof t.length&&Bt(t.length)&&t.length>=0&&t.length<=zr}var Wr="function"==typeof ArrayBuffer;function $r(t){return Wr&&t instanceof ArrayBuffer||"[object ArrayBuffer]"===u(t)}var Gr=ct(Zt.isPrimitive),Zr=ct(Zt.isObject),qr=ct(Zt);function Xr(t,e,r){Z(t,e,{configurable:!1,enumerable:!0,writable:!1,value:r})}function Kr(t,e){if(!(this instanceof Kr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Tt(t))throw new TypeError(N("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Tt(e))throw new TypeError(N("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Xr(this,"re",t),Xr(this,"im",e),this}q(qr,"primitives",Gr),q(qr,"objects",Zr),q(Kr,"name","Complex128"),q(Kr,"BYTES_PER_ELEMENT",8),q(Kr.prototype,"BYTES_PER_ELEMENT",8),q(Kr.prototype,"byteLength",16),q(Kr.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),q(Kr.prototype,"toJSON",(function(){var t={type:"Complex128"};return t.re=this.re,t.im=this.im,t}));var Hr="function"==typeof Math.fround?Math.fround:null,Qr=new Qe(1);var tn="function"==typeof Hr?Hr:function(t){return Qr[0]=t,Qr[0]};function en(t,e){if(!(this instanceof en))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Tt(t))throw new TypeError(N("invalid argument. Real component must be a number. Value: `%s`.",t));if(!Tt(e))throw new TypeError(N("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Xr(this,"re",tn(t)),Xr(this,"im",tn(e)),this}function rn(t){return t instanceof Kr||t instanceof en||"object"==typeof t&&null!==t&&"number"==typeof t.re&&"number"==typeof t.im}function nn(t){return Bt(t/2)}q(en,"name","Complex64"),q(en,"BYTES_PER_ELEMENT",4),q(en.prototype,"BYTES_PER_ELEMENT",4),q(en.prototype,"byteLength",8),q(en.prototype,"toString",(function(){var t=""+this.re;return this.im<0?t+=" - "+-this.im:t+=" + "+this.im,t+="i"})),q(en.prototype,"toJSON",(function(){var t={type:"Complex64"};return t.re=this.re,t.im=this.im,t}));var on=8;function an(t){return"object"==typeof t&&null!==t&&"Complex64Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===on}var un=16;function fn(t){return"object"==typeof t&&null!==t&&"Complex128Array"===t.constructor.name&&t.BYTES_PER_ELEMENT===un}function sn(){return"function"==typeof o&&"symbol"==typeof o("foo")&&e(o,"iterator")&&"symbol"==typeof o.iterator}var ln=sn()?Symbol.iterator:null;function cn(t){return t.re}function hn(t){return t.im}function pn(t,e){return new Qe(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function gn(t,e){return new Ze(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,2*(t.length-e))}function yn(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(Jr(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!rn(n))return new TypeError(N("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(cn(n),hn(n))}return e}var mn=2*Qe.BYTES_PER_ELEMENT,dn=sn();function vn(t){return t instanceof _n||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function bn(t){return t===_n||"Complex128Array"===t.name}function wn(t,e){return new en(t[e*=2],t[e+1])}function _n(){var t,e,r,n;if(e=arguments.length,!(this instanceof _n))return 0===e?new _n:1===e?new _n(arguments[0]):2===e?new _n(arguments[0],arguments[1]):new _n(arguments[0],arguments[1],arguments[2]);if(0===e)r=new Qe(0);else if(1===e)if(kt(arguments[0]))r=new Qe(2*arguments[0]);else if(me(arguments[0]))if((n=(r=arguments[0]).length)&&f(r)&&rn(r[0])){if(r=function(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;ir.byteLength-t)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*mn));r=new Qe(r,t,2*n)}}return q(this,"_buffer",r),q(this,"_length",r.length/2),this}function En(t){return t.re}function xn(t){return t.im}function Tn(t){var e,r,n;for(e=[];!(r=t.next()).done;)if(Jr(n=r.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!rn(n))return new TypeError(N("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(En(n),xn(n))}return e}q(_n,"BYTES_PER_ELEMENT",mn),q(_n,"name","Complex64Array"),q(_n,"from",(function(t){var e,r,n,i,o,a,u,f,l,c,h,p;if(!mt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!bn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((r=arguments.length)>1){if(!mt(n=arguments[1]))throw new TypeError(N("invalid argument. Second argument must be a function. Value: `%s`.",n));r>2&&(e=arguments[2])}if(vn(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,p=0,h=0;h=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(me(t)){if(n){for(f=t.length,u=t.get&&t.set?Ne("default"):Ue("default"),h=0;h=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(s(t)&&dn&&mt(t[ln])){if(!mt((o=t[ln]()).next))throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Jr(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!rn(o))return new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(cn(o),hn(o))}return n}(o,n,e):yn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return wn(this._buffer,t)})),zt(_n.prototype,"buffer",(function(){return this._buffer.buffer})),zt(_n.prototype,"byteLength",(function(){return this._buffer.byteLength})),zt(_n.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),q(_n.prototype,"BYTES_PER_ELEMENT",_n.BYTES_PER_ELEMENT),q(_n.prototype,"copyWithin",(function(t,e){if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*e):this._buffer.copyWithin(2*t,2*e,2*arguments[2]),this})),q(_n.prototype,"entries",(function(){var t,e,r,n,i,o;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,n=this._buffer,r=this._length,o=-1,q(e={},"next",(function(){if(o+=1,i||o>=r)return{done:!0};return{value:[o,wn(n,o)],done:!1}})),q(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(e,ln,(function(){return t.entries()})),e})),q(_n.prototype,"every",(function(t,e){var r,n;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!Bt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));r<0&&(r+=i)<0&&(r=0),r>i&&(r=i)}else r=i}else e=0,r=i;for(a=cn(t),u=hn(t),f=e;f=0;n--)if(i=wn(r,n),t.call(e,i,n,this))return i})),q(_n.prototype,"findLastIndex",(function(t,e){var r,n,i;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length-1;n>=0;n--)if(i=wn(r,n),t.call(e,i,n,this))return n;return-1})),q(_n.prototype,"forEach",(function(t,e){var r,n,i;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n=this._length))return wn(this._buffer,t)})),q(_n.prototype,"includes",(function(t,e){var r,n,i,o,a;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!rn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=cn(t),o=hn(t),r=this._buffer,a=e;a1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=cn(t),o=hn(t),r=this._buffer,a=e;a=r)return{done:!0};return{value:i,done:!1}})),q(e,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(e,ln,(function(){return t.keys()})),e})),q(_n.prototype,"lastIndexOf",(function(t,e){var r,n,i,o,a;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!rn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=cn(t),o=hn(t),r=this._buffer,a=e;a>=0;a--)if(i===r[n=2*a]&&o===r[n+1])return a;return-1})),zt(_n.prototype,"length",(function(){return this._length})),q(_n.prototype,"map",(function(t,e){var r,n,i,o,a;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=wn(r,0),o=1}for(;o1)n=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=wn(r,i-1),o=i-2}for(;o>=0;o--)n=t(n,wn(r,o),o,this);return n})),q(_n.prototype,"reverse",(function(){var t,e,r,n,i,o;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=this._length,t=this._buffer,n=It(r/2),i=0;i1){if(!kt(r=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",r))}else r=0;if(rn(t)){if(r>=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",r));return n[r*=2]=cn(t),void(n[r+1]=hn(t))}if(vn(t)){if(r+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,s=n.byteOffset+r*mn,e.buffer===n.buffer&&e.byteOffsets){for(i=new Qe(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,s=n.byteOffset+r*mn,e.buffer===n.buffer&&e.byteOffsets){for(i=new Qe(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(r*=2,f=0;fu&&(e=u)}}for(r=ti&&(e=i)}}return t>=i?(i=0,r=n.byteLength):t>=e?(i=0,r=n.byteOffset+t*mn):(i=e-t,r=n.byteOffset+t*mn),new this.constructor(n.buffer,r,i<0?0:i)})),q(_n.prototype,"toLocaleString",(function(t,e){var r,n,i,o,a;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Jt(t)&&!Gr(t))throw new TypeError(N("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)r={};else{if(!s(e))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",e));r=e}for(o=this._buffer,i=[],a=0;a=r)return{done:!0};return{value:wn(i,o),done:!1}})),q(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(t,ln,(function(){return e.values()})),t})),q(_n.prototype,"with",(function(t,e){var r,n,i;if(!vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(N("invalid argument. First argument must be an integer. Value: `%s`.",t));if(i=this._length,t<0&&(t+=i),t<0||t>=i)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!rn(e))throw new TypeError(N("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(r=(n=new this.constructor(this._buffer))._buffer)[2*t]=cn(e),r[2*t+1]=hn(e),n}));var An=2*Ze.BYTES_PER_ELEMENT,On=sn();function Vn(t){return t instanceof Rn||"object"==typeof t&&null!==t&&("Complex64Array"===t.constructor.name||"Complex128Array"===t.constructor.name)&&"number"==typeof t._length&&"object"==typeof t._buffer}function Sn(t){return t===Rn||"Complex64Array"===t.name}function jn(t,e){return new Kr(t[e*=2],t[e+1])}function Rn(){var t,e,r,n;if(e=arguments.length,!(this instanceof Rn))return 0===e?new Rn:1===e?new Rn(arguments[0]):2===e?new Rn(arguments[0],arguments[1]):new Rn(arguments[0],arguments[1],arguments[2]);if(0===e)r=new Ze(0);else if(1===e)if(kt(arguments[0]))r=new Ze(2*arguments[0]);else if(me(arguments[0]))if((n=(r=arguments[0]).length)&&f(r)&&rn(r[0])){if(r=function(t,e){var r,n,i,o;for(r=e.length,o=0,i=0;ir.byteLength-t)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*An));r=new Ze(r,t,2*n)}}return q(this,"_buffer",r),q(this,"_length",r.length/2),this}function Ln(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(K(r.value));return e}q(Rn,"BYTES_PER_ELEMENT",An),q(Rn,"name","Complex128Array"),q(Rn,"from",(function(t){var e,r,n,i,o,a,u,f,l,c,h,p;if(!mt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Sn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((r=arguments.length)>1){if(!mt(n=arguments[1]))throw new TypeError(N("invalid argument. Second argument must be a function. Value: `%s`.",n));r>2&&(e=arguments[2])}if(Vn(t)){if(f=t.length,n){for(o=(i=new this(f))._buffer,p=0,h=0;h=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(me(t)){if(n){for(f=t.length,u=t.get&&t.set?Ne("default"):Ue("default"),h=0;h=2))throw new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",c));o[p]=c[0],o[p+1]=c[1]}p+=2}return i}return new this(t)}if(s(t)&&On&&mt(t[ln])){if(!mt((o=t[ln]()).next))throw new TypeError(N("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",t));if(a=n?function(t,e,r){var n,i,o,a;for(n=[],a=-1;!(i=t.next()).done;)if(a+=1,Jr(o=e.call(r,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!rn(o))return new TypeError(N("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(En(o),xn(o))}return n}(o,n,e):Tn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return jn(this._buffer,t)})),zt(Rn.prototype,"buffer",(function(){return this._buffer.buffer})),zt(Rn.prototype,"byteLength",(function(){return this._buffer.byteLength})),zt(Rn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),q(Rn.prototype,"BYTES_PER_ELEMENT",Rn.BYTES_PER_ELEMENT),q(Rn.prototype,"copyWithin",(function(t,e){if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*t,2*e):this._buffer.copyWithin(2*t,2*e,2*arguments[2]),this})),q(Rn.prototype,"entries",(function(){var t,e,r,n,i,o,a;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,t=this._buffer,n=this._length,o=-1,a=-2,q(r={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Kr(t[a+=2],t[a+1]),{value:[o,e],done:!1}})),q(r,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(r,ln,(function(){return e.entries()})),r})),q(Rn.prototype,"every",(function(t,e){var r,n;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!Bt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));r<0&&(r+=i)<0&&(r=0),r>i&&(r=i)}else r=i}else e=0,r=i;for(a=En(t),u=xn(t),f=e;f=0;n--)if(i=jn(r,n),t.call(e,i,n,this))return i})),q(Rn.prototype,"findLastIndex",(function(t,e){var r,n,i;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=this._length-1;n>=0;n--)if(i=jn(r,n),t.call(e,i,n,this))return n;return-1})),q(Rn.prototype,"forEach",(function(t,e){var r,n,i;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n=this._length))return jn(this._buffer,t)})),zt(Rn.prototype,"length",(function(){return this._length})),q(Rn.prototype,"includes",(function(t,e){var r,n,i,o,a;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!rn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=En(t),o=xn(t),r=this._buffer,a=e;a1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=En(t),o=xn(t),r=this._buffer,a=e;a=r)return{done:!0};return{value:i,done:!1}})),q(e,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(e,ln,(function(){return t.keys()})),e})),q(Rn.prototype,"lastIndexOf",(function(t,e){var r,n,i,o,a;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!rn(t))throw new TypeError(N("invalid argument. First argument must be a complex number. Value: `%s`.",t));if(arguments.length>1){if(!Bt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=En(t),o=xn(t),r=this._buffer,a=e;a>=0;a--)if(i===r[n=2*a]&&o===r[n+1])return a;return-1})),q(Rn.prototype,"map",(function(t,e){var r,n,i,o,a;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(n=this._buffer,r=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=jn(r,0),o=1}for(;o1)n=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=jn(r,i-1),o=i-2}for(;o>=0;o--)n=t(n,jn(r,o),o,this);return n})),q(Rn.prototype,"reverse",(function(){var t,e,r,n,i,o;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=this._length,t=this._buffer,n=It(r/2),i=0;i1){if(!kt(r=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",r))}else r=0;if(rn(t)){if(r>=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",r));return n[r*=2]=En(t),void(n[r+1]=xn(t))}if(Vn(t)){if(r+(a=t._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t._buffer,s=n.byteOffset+r*An,e.buffer===n.buffer&&e.byteOffsets){for(i=new Ze(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=t,s=n.byteOffset+r*An,e.buffer===n.buffer&&e.byteOffsets){for(i=new Ze(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(r*=2,f=0;fu&&(e=u)}}for(r=ti&&(e=i)}}return t>=i?(i=0,r=n.byteLength):t>=e?(i=0,r=n.byteOffset+t*An):(i=e-t,r=n.byteOffset+t*An),new this.constructor(n.buffer,r,i<0?0:i)})),q(Rn.prototype,"toLocaleString",(function(t,e){var r,n,i,o,a;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Zt(t)&&!Gr(t))throw new TypeError(N("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)r={};else{if(!s(e))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",e));r=e}for(o=this._buffer,i=[],a=0;a=r)return{done:!0};return{value:jn(i,o),done:!1}})),q(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(t,ln,(function(){return e.values()})),t})),q(Rn.prototype,"with",(function(t,e){var r,n,i;if(!Vn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Bt(t))throw new TypeError(N("invalid argument. First argument must be an integer. Value: `%s`.",t));if(i=this._length,t<0&&(t+=i),t<0||t>=i)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!rn(e))throw new TypeError(N("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(r=(n=new this.constructor(this._buffer))._buffer)[2*t]=En(e),r[2*t+1]=xn(e),n}));var In=Rr.BYTES_PER_ELEMENT,Bn=sn();function Fn(t){return"object"==typeof t&&null!==t&&"BooleanArray"===t.constructor.name&&t.BYTES_PER_ELEMENT===In}function Pn(t){return t===Un}function Un(){var t,e,r,n,i;if(e=arguments.length,!(this instanceof Un))return 0===e?new Un:1===e?new Un(arguments[0]):2===e?new Un(arguments[0],arguments[1]):new Un(arguments[0],arguments[1],arguments[2]);if(0===e)r=new Rr(0);else if(1===e)if(kt(i=arguments[0]))r=new Rr(i);else if(me(i))r=function(t,e){var r,n;for(r=e.length,n=0;nr.byteLength-t)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*In));r=new Rr(r,t,n)}}return q(this,"_buffer",r),q(this,"_length",r.length),this}q(Un,"BYTES_PER_ELEMENT",In),q(Un,"name","BooleanArray"),q(Un,"from",(function(t){var e,r,n,i,o,a,u,f,l;if(!mt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Pn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((r=arguments.length)>1){if(!mt(n=arguments[1]))throw new TypeError(N("invalid argument. Second argument must be a function. Value: `%s`.",n));r>2&&(e=arguments[2])}if(me(t)){if(n){for(f=t.length,u=t.get&&t.set?Ne("default"):Ue("default"),o=(i=new this(f))._buffer,l=0;l=r))return K(e[t])})),zt(Un.prototype,"buffer",(function(){return this._buffer.buffer})),zt(Un.prototype,"byteLength",(function(){return this._buffer.byteLength})),zt(Un.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),q(Un.prototype,"BYTES_PER_ELEMENT",Un.BYTES_PER_ELEMENT),q(Un.prototype,"copyWithin",(function(t,e){if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(t,e):this._buffer.copyWithin(t,e,arguments[2]),this})),q(Un.prototype,"entries",(function(){var t,e,r,n,i,o;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,n=this._buffer,r=this._length,o=-1,q(e={},"next",(function(){if(o+=1,i||o>=r)return{done:!0};return{value:[o,K(n[o])],done:!1}})),q(e,"return",(function(t){if(i=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(e,ln,(function(){return t.entries()})),e})),q(Un.prototype,"every",(function(t,e){var r,n;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!Pt(r))throw new TypeError(N("invalid argument. Third argument must be an integer. Value: `%s`.",r));r<0&&(r+=i)<0&&(r=0),r>i&&(r=i)}else r=i}else e=0,r=i;for(o=t?1:0,a=e;a=0;i--)if(n=K(r[i]),t.call(e,n,i,this))return n})),q(Un.prototype,"findLastIndex",(function(t,e){var r,n,i;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,i=this._length-1;i>=0;i--)if(n=K(r[i]),t.call(e,n,i,this))return i;return-1})),q(Un.prototype,"forEach",(function(t,e){var r,n;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError(N("invalid argument. First argument must be a function. Value: `%s`.",t));for(r=this._buffer,n=0;n=this._length))return K(this._buffer[t])})),q(Un.prototype,"includes",(function(t,e){var r,n;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!X(t))throw new TypeError(N("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(r=this._buffer,n=e;n1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(r=this._buffer,n=e;n0){if(!Jt(t))throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t))}else t=",";for(e=this._buffer,r=[],n=0;n=r)return{done:!0};return{value:i,done:!1}})),q(e,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(e,ln,(function(){return t.keys()})),e})),q(Un.prototype,"lastIndexOf",(function(t,e){var r,n;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!X(t))throw new TypeError(N("invalid argument. First argument must be a boolean. Value: `%s`.",t));if(arguments.length>1){if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(r=this._buffer,n=e;n>=0;n--)if(t===K(r[n]))return n;return-1})),zt(Un.prototype,"length",(function(){return this._length})),q(Un.prototype,"map",(function(t,e){var r,n,i,o;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!mt(t))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",t);for(i=this._buffer,r=(n=new this.constructor(this._length))._buffer,o=0;o1)i=e,o=0;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=K(r[0]),o=1}for(;o1)i=e,o=n-1;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=K(r[n-1]),o=n-2}for(;o>=0;o--)i=t(i,K(r[o]),o,this);return i})),q(Un.prototype,"reverse",(function(){var t,e,r,n,i,o;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._buffer,r=this._length,n=It(r/2),i=0;i1){if(!kt(r=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",r))}else r=0;if(me(t)){if(r+(o=t.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=Fn(t)?t._buffer:t,u=n.byteOffset+r*In,e.buffer===n.buffer&&e.byteOffsetu){for(i=new Rr(e.length),a=0;a=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",r));n[r]=t?1:0}})),q(Un.prototype,"slice",(function(t,e){var r,n,i,o,a,u;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(o=this._buffer,a=this._length,0===arguments.length)t=0,e=a;else{if(!Pt(t))throw new TypeError(N("invalid argument. First argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a)<0&&(t=0),1===arguments.length)e=a;else{if(!Pt(e))throw new TypeError(N("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=a)<0&&(e=0):e>a&&(e=a)}}for(r=ti&&(e=i)}}return t>=i?(i=0,r=n.byteLength):t>=e?(i=0,r=n.byteOffset+t*In):(i=e-t,r=n.byteOffset+t*In),new this.constructor(n.buffer,r,i<0?0:i)})),q(Un.prototype,"toLocaleString",(function(t,e){var r,n,i,o,a;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!Jt(t)&&!Gr(t))throw new TypeError(N("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",t));n=t}if(arguments.length<2)r={};else{if(!s(e))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",e));r=e}for(o=this._buffer,i=[],a=0;a=r)return{done:!0};return{value:K(i[o]),done:!1}})),q(t,"return",(function(t){if(n=!0,arguments.length)return{value:t,done:!0};return{done:!0}})),ln&&q(t,ln,(function(){return e.values()})),t})),q(Un.prototype,"with",(function(t,e){var r,n;if(!Fn(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Pt(t))throw new TypeError(N("invalid argument. First argument must be an integer. Value: `%s`.",t));if(n=this._length,t<0&&(t+=n),t<0||t>=n)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%s`.",t));if(!X(e))throw new TypeError(N("invalid argument. Second argument must be a boolean. Value: `%s`.",e));return(r=new this.constructor(this._buffer))._buffer[t]=e?1:0,r}));var Mn=[Ze,Qe,cr,ir,Tr,dr,Dr,Rr,Pr,_n,Rn,Un],kn=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],Cn=kn.length;function Nn(t){var e;if(f(t))return"generic";if(pt(t))return null;for(e=0;e0?o+=a*(t[u]-1):a<0&&(i+=a*(t[u]-1))}return[i,o]}function Gn(t){return"column-major"===t}q($n,"assign",(function(t,e,r,n){var i,o,a,u,f;for(i=t.length,o=r,a=r,f=0;f0?a+=u*(t[f]-1):u<0&&(o+=u*(t[f]-1))}return n[0]=o,n[1]=a,n}));var Zn=/[-\/\\^$*+?.()|[\]{}]/g;var qn=RegExp.prototype.exec;var Xn=n();function Kn(t){return"object"==typeof t&&(t instanceof RegExp||(Xn?function(t){try{return qn.call(t),!0}catch(t){return!1}}(t):"[object RegExp]"===u(t)))}function Hn(t,e,r){return t.replace(e,r)}function Qn(t,e,r){if(!Jt(t))throw new TypeError(N("invalid argument. First argument must be a string. Value: `%s`.",t));if(Jt(e))e=new RegExp(function(t){var e,r;if(!Jt(t))throw new TypeError(N("invalid argument. Must provide a regular expression string. Value: `%s`.",t));if("/"===t[0])for(r=t.length-1;r>=0&&"/"!==t[r];r--);return void 0===r||r<=0?t.replace(Zn,"\\$&"):(e=(e=t.substring(1,r)).replace(Zn,"\\$&"),t=t[0]+e+t.substring(r))}(e),"g");else if(!Kn(e))throw new TypeError(N("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",e));if(!Jt(r)&&!mt(r))throw new TypeError(N("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",r));return Hn(t,e,r)}var ti={int8:"new Int8Array( [ {{data}} ] )",uint8:"new Uint8Array( [ {{data}} ] )",uint8c:"new Uint8ClampedArray( [ {{data}} ] )",int16:"new Int16Array( [ {{data}} ] )",uint16:"new Uint16Array( [ {{data}} ] )",int32:"new Int32Array( [ {{data}} ] )",uint32:"new Uint32Array( [ {{data}} ] )",float32:"new Float32Array( [ {{data}} ] )",float64:"new Float64Array( [ {{data}} ] )",generic:"[ {{data}} ]",binary:"new Buffer( [ {{data}} ] )",complex64:"new Complex64Array( [ {{data}} ] )",complex128:"new Complex128Array( [ {{data}} ] )",bool:"new BooleanArray( [ {{data}} ] )"};var ei,ri={uint16:dr,uint8:Rr};(ei=new ri.uint16(1))[0]=4660;var ni=52===new ri.uint8(ei.buffer)[0],ii="function"==typeof ArrayBuffer?ArrayBuffer:null;var oi,ai="function"==typeof ArrayBuffer?ArrayBuffer:void 0;oi=function(){var t,e,r;if("function"!=typeof ii)return!1;try{(t=$r(r=new ii(16))&&"function"==typeof ii.isView)&&((e=new Ze(r))[0]=-3.14,e[1]=NaN,t=t&&ii.isView(e)&&16===r.byteLength&&-3.14===e[0]&&e[1]!=e[1])}catch(e){t=!1}return t}()?ai:function(){throw new Error("not implemented")};var ui=oi,fi="function"==typeof DataView;function si(t){return fi&&t instanceof DataView||"[object DataView]"===u(t)}var li="function"==typeof DataView?DataView:null;var ci,hi="function"==typeof DataView?DataView:void 0;ci=function(){var t,e,r;if("function"!=typeof li)return!1;try{r=new ui(24),(t=si(e=new li(r,8))&&"function"==typeof e.getFloat64&&"function"==typeof e.setFloat64)&&(e.setFloat64(0,-3.14),e.setFloat64(8,NaN),t=t&&e.buffer===r&&16===e.byteLength&&8===e.byteOffset&&-3.14===e.getFloat64(0)&&e.getFloat64(8)!=e.getFloat64(8))}catch(e){t=!1}return t}()?hi:function(){throw new Error("not implemented")};var pi=ci,gi="function"==typeof BigInt?BigInt:void 0,yi=["row-major","column-major"];function mi(){return yi.slice()}var di=["row-major","column-major"];function vi(){return{"row-major":101,"column-major":102}}q((function(){return di.slice()}),"enum",vi);var bi={"row-major":101,"column-major":102};function wi(){return{"row-major":bi["row-major"],"column-major":bi["column-major"]}}q(mi,"enum",wi);var _i=["throw","normalize","clamp","wrap"];function Ei(){return _i.slice()}function xi(){return{throw:1,clamp:2,wrap:3,normalize:4}}q(Ei,"enum",xi);var Ti={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256},Ai=wi(),Oi={throw:1,clamp:2,wrap:3,normalize:4};var Vi=4294967295,Si=4294967296,ji=new Rr(8),Ri=new pi(ji.buffer);function Li(t,e,r,n){var i,o,a;if(0===t){for(a=0;a>>0,i=It(t/Si),ni?(Ri.setUint32(0,o,ni),Ri.setUint32(4,i,ni)):(Ri.setUint32(0,i,ni),Ri.setUint32(4,o,ni)),a=0;a>>0,n=It(t/4294967296),r=new pi(e.buffer),ni?(r.setUint32(0,i,ni),r.setUint32(4,n,ni)):(r.setUint32(0,n,ni),r.setUint32(4,i,ni))),e}),"assign",Li);var Ii={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256},Bi=wi(),Fi={throw:1,clamp:2,wrap:3,normalize:4};function Pi(t,e,r,n,i,o){var a,u,f,s,l;if(!(this instanceof Pi))return new Pi(t,e,r,n,i,o);for(s=1,l=0;l=0;a--)t-=o=t%r[a],t/=r[a],i+=o*e[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),q(Pi.prototype,"set",(function(){var t,e;for(t=this._offset,e=0;e=0;u--)t-=a=t%n[u],t/=n[u],o+=a*r[u];return this._accessors?this._buffer.set(e,o):this._buffer[o]=e,this})),q(Pi.prototype,"toString",(function(){var t,e,r,n,i,o;if(e=this._shape.length,r="ndarray( '"+(n=this._dtype)+"', ",t="",this._length<=100)if("complex64"===n||"complex128"===n)for(o=0;o=0;o--)t+=En(i=this.iget(this._length-1-o))+", "+xn(i),o>0&&(t+=", ");else for(o=2;o>=0;o--)t+=this.iget(this._length-1-o),o>0&&(t+=", ")}if(r+=Qn(ti[this.dtype],"{{data}}",t),r+=", ",r+=0===e?"[]":"[ "+this._shape.join(", ")+" ]",r+=", ",r+="[ ",0===e)r+="0";else for(o=0;o0&&e.push("generic"),e)}var Yi=Mi(Ni());function Di(t,e){return null!=t&&("symbol"==typeof e?e in Object(t):String(e)in Object(t))}function zi(t){return mt(t)&&qt(t.alignment)&&qt(t.byteLength)&&mt(t.byteLengthOf)&&mt(t.byteOffsetOf)&&mt(t.bufferOf)&&mt(t.isStruct)&&mt(t.viewOf)&&e(t,"fields")&&e(t,"layout")}var Ji,Wi,$i,Gi={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float16:10,float32:11,float64:12,complex32:13,complex64:14,complex128:15,binary:16,generic:17,notype:18,userdefined_type:256};function Zi(t){var e=Gi[t];return Tt(e)?e:null}function qi(t){var e=typeof t;return"string"===e?null===Zi(t)?null:t:"number"===e?Ve(t):"object"===e&&t?String(t):zi(t)?t.layout:null}function Xi(t,r){var n,i,o;if(n=arguments.length,!(this instanceof Xi))return n<2?new Xi(t):new Xi(t,r);if(Yi(t))i="builtin";else{if(function(t){return t instanceof Xi||"object"==typeof t&&null!==t&&"DataType"===t.constructor.name&&Jt(t.char)&&Jt(t.description)&&Jt(t.byteOrder)&&Di(t,"value")}(t))return new Xi(t.value,{description:t.description});if(!zi(t))throw new TypeError(N("invalid argument. First argument must be either a supported data type string, a struct constructor, or another data type instance. Value: `%s`.",t));i="struct"}if(n>1){if(!xt(o=r))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",o));if(e(o,"description")&&!Jt(o.description))throw new TypeError(N("invalid option. `%s` option must be a string. Option: `%s`.","description",o.description))}else o={};return q(this,"_value",t),q(this,"_description",o.description||function(t){return 0===arguments.length?{binary:"byte",bool:"boolean",complex32:"half-precision floating-point complex number",complex64:"single-precision floating-point complex number",complex128:"double-precision floating-point complex number",float16:"half-precision floating-point number",bfloat16:"brain floating-point number",float32:"single-precision floating-point number",float64:"double-precision floating-point number",float128:"quadruple-precision floating-point number",generic:"generic array value",int8:"signed 8-bit integer",int16:"signed 16-bit integer",int32:"signed 32-bit integer",int64:"signed 64-bit integer",int128:"signed 128-bit integer",int256:"signed 256-bit integer",uint8:"unsigned 8-bit integer",uint8c:"unsigned 8-bit integer (clamped)",uint16:"unsigned 16-bit integer",uint32:"unsigned 32-bit integer",uint64:"unsigned 64-bit integer",uint128:"unsigned 128-bit integer",uint256:"unsigned 256-bit integer"}:(void 0===Ji&&(Ji={binary:"byte",bool:"boolean",complex32:"half-precision floating-point complex number",complex64:"single-precision floating-point complex number",complex128:"double-precision floating-point complex number",float16:"half-precision floating-point number",bfloat16:"brain floating-point number",float32:"single-precision floating-point number",float64:"double-precision floating-point number",float128:"quadruple-precision floating-point number",generic:"generic array value",int8:"signed 8-bit integer",int16:"signed 16-bit integer",int32:"signed 32-bit integer",int64:"signed 64-bit integer",int128:"signed 128-bit integer",int256:"signed 256-bit integer",uint8:"unsigned 8-bit integer",uint8c:"unsigned 8-bit integer (clamped)",uint16:"unsigned 16-bit integer",uint32:"unsigned 32-bit integer",uint64:"unsigned 64-bit integer",uint128:"unsigned 128-bit integer",uint256:"unsigned 256-bit integer"}),Ji[qi(t)]||null)}(t)||""),q(this,"_char",function(t){return 0===arguments.length?{binary:"r",bool:"x",complex32:"j",complex64:"c",complex128:"z",float16:"h",bfloat16:"e",float32:"f",float64:"d",float128:"g",generic:"o",int8:"s",int16:"k",int32:"i",int64:"l",int128:"m",int256:"n",uint8:"b",uint8c:"a",uint16:"t",uint32:"u",uint64:"v",uint128:"w",uint256:"y"}:(void 0===Wi&&(Wi={binary:"r",bool:"x",complex32:"j",complex64:"c",complex128:"z",float16:"h",bfloat16:"e",float32:"f",float64:"d",float128:"g",generic:"o",int8:"s",int16:"k",int32:"i",int64:"l",int128:"m",int256:"n",uint8:"b",uint8c:"a",uint16:"t",uint32:"u",uint64:"v",uint128:"w",uint256:"y"}),Wi[qi(t)]||null)}(t)||""),q(this,"_enum",function(t){var e=typeof t;return"number"===e?Ve(t)?t:null:"string"===e?Zi(t):"object"===e&&t&&Pt(t.enum)?t.enum:zi(t)?Zi("userdefined_type"):null}(t)||-1),q(this,"_alignment",function(t){var e;return 0===arguments.length?{binary:1,bool:1,complex32:2,complex64:4,complex128:8,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32}:(void 0===$i&&($i={binary:1,bool:1,complex32:2,complex64:4,complex128:8,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32}),t?qt(e=t.alignment)?e:$i[qi(t)]||null:null)}(t)||-1),q(this,"_byteLength",je(t)||-1),q(this,"_byteOrder","host"),q(this,"_type",i),this}function Ki(t){return t instanceof Xi||"object"==typeof t&&null!==t&&Pt(t.alignment)&&Pt(t.byteLength)&&Jt(t.byteOrder)&&Jt(t.char)&&Pt(t.enum)&&Di(t,"value")}function Hi(t){return mt(t)&&qt(t.alignment)&&qt(t.byteLength)&&mt(t.byteLengthOf)&&mt(t.byteOffsetOf)&&mt(t.bufferOf)&&mt(t.viewOf)||function(t){return t instanceof Xi||"object"==typeof t&&null!==t&&Pt(t.alignment)&&Pt(t.byteLength)&&Jt(t.byteOrder)&&Jt(t.char)&&Pt(t.enum)&&Di(t,"value")}(t)&&Hi(t.value)}function Qi(t,e){if(Yi(t));else if(Ki(t))t=String(t);else{if(!Hi(t))return!1;t=t.layout}if(Yi(e));else if(Ki(e))e=String(e);else{if(!Hi(e))return!1;e=e.layout}return t===e}function to(t){return Yi(t)||Ki(t)||Hi(t)}q(Xi,"name","DataType"),zt(Xi.prototype,"alignment",(function(){return this._alignment})),zt(Xi.prototype,"byteLength",(function(){return this._byteLength})),zt(Xi.prototype,"byteOrder",(function(){return this._byteOrder})),zt(Xi.prototype,"char",(function(){return this._char})),zt(Xi.prototype,"description",(function(){return this._description})),zt(Xi.prototype,"enum",(function(){return this._enum})),zt(Xi.prototype,"value",(function(){return this._value})),q(Xi.prototype,"toJSON",(function(){return{type:"DataType",value:this.toString(),byteOrder:this._byteOrder,description:this._description}})),q(Xi.prototype,"toString",(function(){return"struct"===this._type?this._value.layout:String(this._value)})),q(Xi.prototype,"valueOf",(function(){return this.toString()}));var eo=Mi(mi()),ro=["none","equiv","safe","mostly-safe","same-kind","unsafe"];function no(){return ro.slice()}q(no,"enum",(function(){return{none:0,equiv:1,safe:2,"mostly-safe":3,"same-kind":4,unsafe:5}}));var io=no(),oo=io.length;function ao(t){var e;for(e=0;e0}(t,e):"mostly-safe"===r?function(t,e){var r;return(t=qi(t))===(e=qi(e))||!!(r=ho[t])&&r[e]>0}(t,e):function(t,e){var r;return(t=qi(t))===(e=qi(e))||!!(r=yo[t])&&r[e]>0}(t,e)))}function vo(t,e){return Gn(e)?function(t){var e,r,n;for(e=[],r=1,n=0;n=0;i--)r[i]=n,n*=t[i];return r}(t)}function bo(t,e){var r,n,i;for(n=t.length,r=0,i=0;i=0&&t.length<=zr}(e))return!1;if(r=e.length,0===r)return!1;for(n=0;n=0;n--)e[n]=r,r*=t[n];return e}(t,r)}));var Eo=_o(Nt.isPrimitive),xo=_o(Nt.isObject),To=_o(Nt);q(To,"primitives",Eo),q(To,"objects",xo);var Ao=_o(Mt.isPrimitive),Oo=_o(Mt.isObject),Vo=_o(Mt);function So(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"},order:"row-major",casting:"safe",index_mode:"throw"}}q(Vo,"primitives",Ao),q(Vo,"objects",Oo);var jo={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"},order:"row-major",casting:"safe",index_mode:"throw"},Ro={"dtypes.default":jo.dtypes.default,"dtypes.numeric":jo.dtypes.numeric,"dtypes.real":jo.dtypes.real,"dtypes.floating_point":jo.dtypes.floating_point,"dtypes.real_floating_point":jo.dtypes.real_floating_point,"dtypes.complex_floating_point":jo.dtypes.complex_floating_point,"dtypes.integer":jo.dtypes.integer,"dtypes.signed_integer":jo.dtypes.signed_integer,"dtypes.unsigned_integer":jo.dtypes.unsigned_integer,"dtypes.boolean":jo.dtypes.boolean,"dtypes.index":jo.dtypes.index,"dtypes.integer_index":jo.dtypes.integer_index,"dtypes.boolean_index":jo.dtypes.boolean_index,"dtypes.mask_index":jo.dtypes.mask_index,order:jo.order,casting:jo.casting,index_mode:jo.index_mode};function Lo(t){var e=typeof t;return null===t||"object"!==e&&"function"!==e?new TypeError(N("invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.",t)):null}q(So,"get",(function(t){var e=Ro[t];return void 0===e?null:e}));var Io=Object.create;function Bo(){}var Fo="function"==typeof Io?Io:function(t){return Bo.prototype=t,new Bo};function Po(t,e){return t<0?0:t>e?e:t}function Uo(t,e){var r=e+1;return t<0?((t+=r)<0&&0!==(t%=r)&&(t+=r),t):t>e?((t-=r)>e&&(t%=r),t):t}function Mo(t,e){return t<0?(t+=e+1)<0?-1:t:t>e?-1:t}var ko=Mi(Ei()),Co={wrap:Uo,clamp:Po,normalize:function(t,e){var r=Mo(t,e);if(r<0||r>e)throw new RangeError(N("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return r},throw:function(t,e){if(t<0||t>e)throw new RangeError(N("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return t}};function No(t,e,r){var n;if("clamp"===r)return Po(t,e);if("wrap"===r)return Uo(t,e);if(n=t,"normalize"===r&&(n=Mo(n,e)),n<0||n>e)throw new RangeError(N("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",e,t));return n}q(No,"factory",(function(t){if(!ko(t))throw new TypeError(N("invalid argument. First argument must be a recognized index mode. Value: `%s`.",t));return Co[t]}));var Yo=Pi.prototype.iget;var Do=Pi.prototype.iset;function zo(t,e){var r,n;for(r=[],n=0;n0))throw new TypeError(N("invalid argument. Third argument must be an array-like object containing nonnegative integers. Value: `%s`.",n));if((f=n.length)>Jo)throw new RangeError(N("invalid argument. Number of dimensions must not exceed %u due to stack limits. Value: `%u`.",Jo,f));if(!Ao(i))throw new TypeError(N("invalid argument. Fourth argument must be an array-like object containing integers. Value: `%s`.",i));if(f>0){if(i.length!==f)throw new RangeError(N("invalid argument. Fourth argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.",f,i.length))}else{if(1!==i.length)throw new RangeError("invalid argument. Fourth argument length must be equal to 1 when creating a zero-dimensional ndarray.");if(0!==i[0])throw new RangeError(N("invalid argument. Fourth argument must contain a single element equal to 0. Value: `%d`.",i[0]))}if(!kt(o))throw new TypeError(N("invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.",o));if(!eo(a))throw new TypeError(N("invalid argument. Sixth argument must be a supported order. Value: `%s`.",a));if(f>0&&!function(t,e,r,n){var i=$n(e,r,n);return i[0]>=0&&i[1]0)throw new Error("invalid arguments. Input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.");if((s={}).mode=Wo,s.readonly=$o,arguments.length>6&&(l=function(t,r){var n;if(!xt(r))return new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",r));if(e(r,"mode")&&(t.mode=r.mode,!ko(t.mode)))return new TypeError(N("invalid option. `%s` option must be a recognized mode. Option: `%s`.","mode",t.mode));if(e(r,"submode")){if(t.submode=r.submode,!Jr(t.submode))return new TypeError(N("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",t.submode));if(0===t.submode.length)return new TypeError(N("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",t.submode.join(",")));for(n=0;n0){if(!Pt(t))throw new TypeError(N("invalid argument. Index must be an integer. Value: `%s`.",t));return t=No(t,this._length-1,this._mode),Yo.call(this,t)}return Yo.call(this)})),q(Go.prototype,"set",(function(){var t,e,r,n;if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(arguments.length!==this._ndims+1)throw new RangeError(N("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(t=this._offset,r=this._submode.length,n=0;n0){if(!Pt(t))throw new TypeError(N("invalid argument. Index must be an integer. Value: `%s`.",t));t=No(t,this._length-1,this._mode),Do.call(this,t,e)}else Do.call(this,t);return this}));var Zo=Object.prototype.isPrototypeOf;function qo(t,e,r,n,i,o,a){var u,f,s,l,c,h,p;for(u=e.data,f=i.data,l=e.accessors[0],s=i.accessors[1],c=n,h=a,p=0;p0)for(l=0;l0)for(h=0;h2){if(n=sa(la[r]))return new n(t,e);throw new TypeError(N("invalid argument. Must provide a recognized data type. Value: `%s`.",r))}return new ca(t,e)}(n,i,ha[t.type])}}var ga={float64:Ze,float32:Qe,int16:Tr,int32:cr,int8:Dr,uint16:dr,uint32:ir,uint8:Rr,uint8c:Pr,complex64:_n,complex128:Rn,bool:Un};function ya(t){return ga[t]||null}function ma(t,e){return new Rr(t.buffer,t.byteOffset+t.BYTES_PER_ELEMENT*e,t.length-e)}function da(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}}}var va={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}},ba={"dtypes.default":va.dtypes.default,"dtypes.numeric":va.dtypes.numeric,"dtypes.real":va.dtypes.real,"dtypes.floating_point":va.dtypes.floating_point,"dtypes.real_floating_point":va.dtypes.real_floating_point,"dtypes.complex_floating_point":va.dtypes.complex_floating_point,"dtypes.integer":va.dtypes.integer,"dtypes.signed_integer":va.dtypes.signed_integer,"dtypes.unsigned_integer":va.dtypes.unsigned_integer,"dtypes.boolean":va.dtypes.boolean,"dtypes.index":va.dtypes.index,"dtypes.integer_index":va.dtypes.integer_index,"dtypes.boolean_index":va.dtypes.boolean_index,"dtypes.mask_index":va.dtypes.mask_index};q(da,"get",(function(t){var e=ba[t];return void 0===e?null:e}));var wa=da.get("dtypes.default"),_a=ya("complex64"),Ea=ya("complex128"),xa=ya("bool");function Ta(){var t,e,r,n;if(null===(r=ya(e=(t=arguments.length)&&Jt(arguments[t-1])?arguments[t-=1]:wa)))throw new TypeError(N("invalid argument. Must provide a recognized data type. Value: `%s`.",e));return t<=0?new r(0):1===t?((n=arguments[0])instanceof _a?n=pn(n,0):n instanceof Ea?n=gn(n,0):n instanceof xa&&(n=ma(n,0)),new r(n)):2===t?new r(arguments[0],arguments[1]):new r(arguments[0],arguments[1],arguments[2])}function Aa(t){if(t.length)return t.isStructType?function(t){return function(){var e,r,n,i;for(e=(r=this[ra]).byteOffset+t.byteOffset,n=[],i=0;i0&&e.push("generic"),e)}var ja=Mi(Sa("real_floating_point")),Ra=Mi(Sa("signed_integer"));function La(t){return"bigint"==typeof t}function Ia(t){return"object"==typeof t&&"[object BigInt]"===u(t)&&function(t){try{return"bigint"==typeof t.valueOf()}catch(t){return!1}}(t)}function Ba(t){return La(t)||Ia(t)}function Fa(t){return function(){return t}}q(Ba,"isPrimitive",La),q(Ba,"isObject",Ia);var Pa,Ua=Fa(!1),Ma=Fa(!1),ka=Fa(!1);q(Ua,"isPrimitive",Ma),q(Ua,"isObject",ka),Pa=Dt()?Ba:Ua;const{isPrimitive:Ca}=Pa;var Na=1401298464324817e-60,Ya=16777215,Da=-16777215;function za(t){return t!=t||t===Rt||t===Lt?"float32":Bt(t)?t>=Da&&t<=Ya?"float32":"float64":t>-Na&&t=kr?"int8":t>=wr?"int16":t>=ur?"int32":"float64":t<=Or?"uint8":t<=pr?"uint16":t<=le?"uint32":"float64":t>-Na&&t=kr?"int8":t>=wr?"int16":t>=ur?"int32":"float64":t<=Mr?"int8":t<=br?"int16":t<=ar?"int32":"float64"}(r):Ja(r):Qa.dtypes.real,i=r):rn(r)?(n=Xa(r)||("float32"===t.type?"complex64":"complex128"),i=r.re):X(r)?(n="bool",i=Ka(r)):Ca(r)?(n="int64",i=Ha(r)):(n="generic",i=r);if(!mo(n,t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[ra][e](t.byteOffset,i,ni)}}function eu(t){return K(t)}function ru(t){return K(t.re||t.im)}function nu(t,e){return function(r){var n,i;X(r)?(n="bool",i=Ka(r)):Tt(r)?(n=Qa.dtypes.real,i=Ka(eu(r))):Ca(r)?(n="int64",i=Ka(function(t){return K(t)}(r))):rn(r)?(n=Xa(r)||Qa.dtypes.complex,i=Ka(ru(r))):(n="generic",i=K(r));if(!mo(n,t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[ra][e](t.byteOffset,i,ni)}}function iu(t,e){return function(r){var n,i;Ca(r)?(n="int64",i=r):Tt(r)?Pt(r)?(n=Ja(r),i=gi(r)):(n=Qa.dtypes.real,i=gi(It(r))):X(r)?(n="bool",i=function(t){return gi(t?1:0)}(r)):rn(r)?(n=Xa(r)||Qa.dtypes.complex,i=gi(It(r.re))):(n="generic",i=gi(It(At(i))));if(!mo(n,t.type,t.castingMode))throw new TypeError(N("invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].",t.name,t.type,n));this[ra][e](t.byteOffset,i,ni)}}function ou(t){return s(t)&&si(t[ra])}var au=Mi(Sa("complex_floating_point")),uu=Mi(Sa("boolean")),fu=Mi(Sa("real"));function su(t,e){if(fn(t))return gn(t,e);if(an(t))return pn(t,e);throw new TypeError(N("invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.",t))}function lu(t,e){return e>0?0:(1-t)*e}var cu=8;function hu(t,e,r,n,i){var o,a,u,f;if(t<=0)return r;if((u=Yn(r)).accessorProtocol)return function(t,e,r,n,i){var o,a,u,f;for(o=r.data,a=r.accessors[1],u=i,f=0;f0)for(f=0;f0&&(u+=e),_u(s=a(o,f))||(u+=String(s)),f+=n;return u}(t,e,u,n,i);for(a=i,o="",s=0;s0&&(o+=e),_u(f=r[a])||(o+=String(f)),a+=n;return o}function xu(t,e){return Eu(t.length,e,t,1,0)}function Tu(t,e){return X(t)?null:new TypeError(N("invalid argument. `%s` field must be a boolean. Value: `%s`.",e,t))}q((function(t,e,r,n){return Eu(t,e,r,n,lu(t,n))}),"ndarray",Eu);var Au=["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float32","float64","complex64","complex128","bool"];var Ou,Vu={int8:1,int16:2,int32:4,int64:8,uint8:1,uint16:2,uint32:4,uint64:8,float16:2,float32:4,float64:8,complex32:2,complex64:4,complex128:8,bool:1},Su=["name","type"],ju={name:function(t,e){return Jt(t)||t.length>0?null:new TypeError(N("invalid argument. `%s` field must be a non-empty string. Value: `%s`.",e,t))},type:function(t){return Ui(Au,t)||zi(t)?null:new TypeError(N('invalid argument. `%s` field must be either a struct type or one of the following: "%s". Value: `%s`.',"type",xu(Au,", "),t))},description:function(t,e){return Jt(t)?null:new TypeError(N("invalid argument. `%s` field must be a string. Value: `%s`.",e,t))},length:function(t,e){return qt(t)?null:new TypeError(N("invalid argument. `%s` field must be a positive integer. Value: `%s`.",e,t))},enumerable:Tu,writable:Tu,default:Fa(null),castingMode:(Ou=["none","safe","mostly-safe","same-kind","unsafe"],function(t,e){return Ui(Ou,t)?null:new TypeError(N('invalid argument. `%s` field must be one of the following: "%s". Value: `%s`.',e,xu(Ou,", "),t))})};function Ru(t,e){var r,n,i,o,a;for(r={isStructType:!1,description:"",byteLength:0,byteOffset:0,alignment:0,padding:0,enumerable:!0,writable:!0,default:void 0,castingMode:"none"},a=0;ae&&(e=r);return e}function Iu(t){var e,r,n,i,o,a,u;if(0===(e=t.fields).length)return null;for(n=[],u=0;u0&&o.byteOffset===t[a-1].byteOffset||(o.isStructType?e.push(Hn(o.type.layout,n,Mu(o.byteOffset))):e.push(N("|<%s>[%u,%u]",o.type,o.byteOffset,o.byteLength)));return"|"===(r=N("%s|",e.join("")))[r.length-2]&&(r=r.substring(0,r.length-1)),r}var Cu=["none","linear","layout"],Nu=Mi(Cu);function Yu(t,r,n){var i;if(!xt(n))throw new TypeError(N("invalid argument. Options argument must be an object. Value: `%s`.",n));if(i={format:"none"},e(n,"format")&&(i.format=n.format,!Nu(i.format)))throw new TypeError(N('invalid option. `%s` option must be one of the following: "%s". Option: `%s`.',"format",xu(Cu,", "),n.format));return"linear"===i.format?function(t,e){var r,n,i,o,a,u,f,s,l,c,h,p,g,y,m,d,v,b,w,_,E,x;for(d=e.length,r="%"+(t.byteLength-1).toString().length+"s",y=0,_=0;_y&&(y=m);for(n="%"+y+"s",i="// %s",u="%s: %s %s",c=0,s=[],_=0;_0&&v.byteOffset===e[_-1].byteOffset)){for(l=_1?" (byte %u)":"",l){for(a=" => union: %s",f=[],x=_+1;x":b.type,f.push(N("%s<%s>[%u]",b.name,w,E%b.alignment)),x+=1;a=N(a,f.join(", "))}else a="";f=N(o+a,E%v.alignment),g=v.length?N(i,N("%s[%u]%s",v.type,It(E/v.alignment),f)):N(i,N("%s%s",v.type,f)),s.push(N(u,h,p,g)),c+=1}for(E=0;E"}function Du(){}var zu="foo"===Du.name;var Ju=[Ze,Qe,cr,ir,Tr,dr,Dr,Rr,Pr],Wu=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],$u=$e()?_t(Ze):Gu;function Gu(){}$u="TypedArray"===function(t){if(!1===mt(t))throw new TypeError(N("invalid argument. Must provide a function. Value: `%s`.",t));return zu?t.name:lt.exec(t.toString())[1]}($u)?$u:Gu;var Zu=[Rn,_n],qu=["Complex64Array","Complex128Array"];function Xu(){return"function"==typeof o&&"symbol"==typeof o("foo")&&e(o,"hasInstance")&&"symbol"==typeof o.hasInstance}var Ku=Xu()?Symbol.hasInstance:null,Hu=Xu();function Qu(t,e){if("function"!=typeof e&&(!Hu||"object"!=typeof e||"function"!=typeof e[Ku]))throw new TypeError(N("invalid argument. Second argument must be callable. Value: `%s`.",e));return t instanceof e}var tf=[[Ze,"Float64Array"],[Qe,"Float32Array"],[cr,"Int32Array"],[ir,"Uint32Array"],[Tr,"Int16Array"],[dr,"Uint16Array"],[Dr,"Int8Array"],[Rr,"Uint8Array"],[Pr,"Uint8ClampedArray"],[_n,"Complex64Array"],[Rn,"Complex128Array"],[Un,"BooleanArray"]];function ef(t){var e,r;for(r=0;r0){if(!s(t))throw new TypeError(N("invalid argument. First argument must be an object. Value: `%s`.",t));g=t}if(q(this,ra,p),void 0!==g){for(f=ea(void 0,a.length),h={},d=0;d0&&((o=t[u-1]).padding=n,wu(a)&&Uu(o.fields,n)),a.byteOffset=i,wu(a))for(f=0;f0?arguments[0]:{})})),q(l.prototype,"toJSON",(function(){if(!(this instanceof l))throw new Error("invalid invocation. `this` is not a struct instance.");return function(t,e){var r,n,i,o;for(r={},o=0;o=u.byteLength)throw new RangeError(N("invalid argument. Second argument exceeds the bounds of the ArrayBuffer. Value: `%s`.",r));if(2===a){if(!Pt(f=(u.byteLength-r)/e))throw new RangeError(N("invalid argument. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",e,u.byteLength-r))}else{if(!kt(f=n))throw new TypeError(N("invalid argument. Third argument must be a nonnegative integer. Value: `%s`.",f));if(f*e>u.byteLength-r)throw new RangeError(N("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",f*e))}}return q(this,"_buffer",u),q(this,"_byteOffset",r||0),q(this,"_byteLength",f*e),q(this,"_length",f),this}return e=i.byteLength,r=i.layout,n=i.fields,q(o,"BYTES_PER_ELEMENT",e),q(o,"name",uf),q(o,"struct",i),zt(o.prototype,"buffer",(function(){return this._buffer})),zt(o.prototype,"byteLength",(function(){return this._byteLength})),zt(o.prototype,"byteOffset",(function(){return this._byteOffset})),q(o.prototype,"BYTES_PER_ELEMENT",o.BYTES_PER_ELEMENT),q(o.prototype,"get",(function(t){if(!a(this))throw new TypeError(N("invalid invocation. `this` is not a %s.",uf));if(!kt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));if(!(t>=this._length))return new i(this._buffer,this._byteOffset+t*e,e)})),zt(o.prototype,"length",(function(){return this._length})),q(o.prototype,"set",(function(t){var o,u,f,l,c,h,p,g,y,m,d,v;if(!a(this))throw new TypeError(N("invalid invocation. `this` is not a %s.",uf));if(l=this._buffer,arguments.length>1){if(!kt(f=arguments[1]))throw new TypeError(N("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",f))}else f=0;if(u={format:"layout"},p=i.byteLength,!me(t)||Ui(n,"length")){if(f>=this._length)throw new RangeError(N("invalid argument. Index argument is out-of-bounds. Value: `%u`.",f));if(!s(t))throw new TypeError(N("invalid argument. Must provide either a valid object or a struct instance. Value: `%s`.",t));if(t.toString(u)===r)return o=i.viewOf(t),void Qo(p,new Rr(o.buffer,o.byteOffset,p),1,0,new Rr(l,this._byteOffset+f*e,p),1,0);for(y=new i(l,this._byteOffset+f*e,p),d=0;dthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(h=(o=t).get&&o.set?Ne("default"):Ue("default"),v=this._byteOffset+f*e,o.buffer===l&&o.byteOffsetv){for(c=[],d=0;d>18&63]+cf[i>>12&63]+cf[i>>6&63]+cf[63&i]);return o.join("")}function df(t){var e;gf||yf();for(var r=t.length,n=r%3,i="",o=[],a=16383,u=0,f=r-n;uf?f:u+a));return 1===n?(e=t[r-1],i+=cf[e>>2],i+=cf[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=cf[e>>10],i+=cf[e>>4&63],i+=cf[e<<2&63],i+="="),o.push(i),o.join("")}function vf(t,e,r,n,i){var o,a,u=8*i-n-1,f=(1<>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+t[e+c],c+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=h,l-=8);if(0===o)o=1-s;else{if(o===f)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=s}return(p?-1:1)*a*Math.pow(2,o-n)}function bf(t,e,r,n,i,o){var a,u,f,s=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+c>=1?h/f:h*Math.pow(2,1-c))*f>=2&&(a++,f/=2),a+c>=l?(u=0,a=l):a+c>=1?(u=(e*f-1)*Math.pow(2,i),a+=c):(u=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&u,p+=g,u/=256,i-=8);for(a=a<0;t[r+p]=255&a,p+=g,a/=256,s-=8);t[r+p-g]|=128*y}var wf={}.toString,_f=Array.isArray||function(t){return"[object Array]"==wf.call(t)};Af.TYPED_ARRAY_SUPPORT=void 0===lf.TYPED_ARRAY_SUPPORT||lf.TYPED_ARRAY_SUPPORT;var Ef=xf();function xf(){return Af.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Tf(t,e){if(xf()=xf())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+xf().toString(16)+" bytes");return 0|t}function Lf(t){return!(null==t||!t._isBuffer)}function If(t,e){if(Lf(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return os(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return as(t).length;default:if(n)return os(t).length;e=(""+e).toLowerCase(),n=!0}}function Bf(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zf(this,e,r);case"utf8":case"utf-8":return Jf(this,e,r);case"ascii":return $f(this,e,r);case"latin1":case"binary":return Gf(this,e,r);case"base64":return zf(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qf(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function Ff(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Pf(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=Af.from(e,n)),Lf(e))return 0===e.length?-1:Uf(t,e,r,n,i);if("number"==typeof e)return e&=255,Af.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Uf(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Uf(t,e,r,n,i){var o,a=1,u=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,f/=2,r/=2}function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=r;ou&&(r=u-f),o=r;o>=0;o--){for(var c=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function zf(t,e,r){return 0===e&&r===t.length?df(t):df(t.slice(e,r))}function Jf(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:s>223?3:s>191?2:1;if(i+c<=r)switch(c){case 1:s<128&&(l=s);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&s)<<6|63&o)>127&&(l=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&s)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(l=f);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(f=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&f<1114112&&(l=f)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(t){var e=t.length;if(e<=Wf)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},Af.prototype.compare=function(t,e,r,n,i){if(!Lf(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(o,a),f=this.slice(n,i),s=t.slice(e,r),l=0;li)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return Mf(this,t,e,r);case"utf8":case"utf-8":return kf(this,t,e,r);case"ascii":return Cf(this,t,e,r);case"latin1":case"binary":return Nf(this,t,e,r);case"base64":return Yf(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Df(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Af.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Wf=4096;function $f(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function Kf(t,e,r,n,i,o){if(!Lf(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function Hf(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function Qf(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function ts(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function es(t,e,r,n,i){return i||ts(t,0,r,4),bf(t,e,r,n,23,4),r+4}function rs(t,e,r,n,i){return i||ts(t,0,r,8),bf(t,e,r,n,52,8),r+8}Af.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},Af.prototype.readUInt8=function(t,e){return e||Xf(t,1,this.length),this[t]},Af.prototype.readUInt16LE=function(t,e){return e||Xf(t,2,this.length),this[t]|this[t+1]<<8},Af.prototype.readUInt16BE=function(t,e){return e||Xf(t,2,this.length),this[t]<<8|this[t+1]},Af.prototype.readUInt32LE=function(t,e){return e||Xf(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Af.prototype.readUInt32BE=function(t,e){return e||Xf(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Af.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||Xf(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},Af.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||Xf(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Af.prototype.readInt8=function(t,e){return e||Xf(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Af.prototype.readInt16LE=function(t,e){e||Xf(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Af.prototype.readInt16BE=function(t,e){e||Xf(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Af.prototype.readInt32LE=function(t,e){return e||Xf(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Af.prototype.readInt32BE=function(t,e){return e||Xf(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Af.prototype.readFloatLE=function(t,e){return e||Xf(t,4,this.length),vf(this,t,!0,23,4)},Af.prototype.readFloatBE=function(t,e){return e||Xf(t,4,this.length),vf(this,t,!1,23,4)},Af.prototype.readDoubleLE=function(t,e){return e||Xf(t,8,this.length),vf(this,t,!0,52,8)},Af.prototype.readDoubleBE=function(t,e){return e||Xf(t,8,this.length),vf(this,t,!1,52,8)},Af.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||Kf(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},Af.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,1,255,0),Af.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Af.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,2,65535,0),Af.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Hf(this,t,e,!0),e+2},Af.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,2,65535,0),Af.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Hf(this,t,e,!1),e+2},Af.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,4,4294967295,0),Af.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Qf(this,t,e,!0),e+4},Af.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,4,4294967295,0),Af.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Qf(this,t,e,!1),e+4},Af.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Kf(this,t,e,r,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o>0)-u&255;return e+r},Af.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Kf(this,t,e,r,i-1,-i)}var o=r-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+r},Af.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,1,127,-128),Af.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Af.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,2,32767,-32768),Af.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Hf(this,t,e,!0),e+2},Af.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,2,32767,-32768),Af.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Hf(this,t,e,!1),e+2},Af.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,4,2147483647,-2147483648),Af.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Qf(this,t,e,!0),e+4},Af.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Kf(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Af.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Qf(this,t,e,!1),e+4},Af.prototype.writeFloatLE=function(t,e,r){return es(this,t,e,!0,r)},Af.prototype.writeFloatBE=function(t,e,r){return es(this,t,e,!1,r)},Af.prototype.writeDoubleLE=function(t,e,r){return rs(this,t,e,!0,r)},Af.prototype.writeDoubleBE=function(t,e,r){return rs(this,t,e,!1,r)},Af.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!Af.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function as(t){return function(t){var e,r,n,i,o,a;gf||yf();var u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[u-2]?2:"="===t[u-1]?1:0,a=new pf(3*u/4-o),n=o>0?u-4:u;var f=0;for(e=0,r=0;e>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===o?(i=hf[t.charCodeAt(e)]<<2|hf[t.charCodeAt(e+1)]>>4,a[f++]=255&i):1===o&&(i=hf[t.charCodeAt(e)]<<10|hf[t.charCodeAt(e+1)]<<4|hf[t.charCodeAt(e+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(ns,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function us(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function fs(t){return null!=t&&(!!t._isBuffer||ss(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&ss(t.slice(0,0))}(t))}function ss(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}sf(Object.freeze({__proto__:null,Buffer:Af,INSPECT_MAX_BYTES:50,SlowBuffer:function(t){return+t!=t&&(t=0),Af.alloc(+t)},isBuffer:fs,kMaxLength:Ef})).Buffer;var ls=function(){throw new Error("not implemented")};function cs(){throw new Error("not implemented")}var hs={binary:ls,float64:Ze,float32:Qe,float16:cs,generic:Array,int16:Tr,int32:cr,int8:Dr,uint16:dr,uint32:ir,uint8:Rr,uint8c:Pr,complex32:cs,complex64:_n,complex128:Rn,bool:Un},ps={};function gs(t){var e,r,n;return!mt(t)&&(n=qi(t),r=hs[n]||null)?r:Hi(t)?(n?e=t.value:n=(e=t).layout,(r=ps[n])||(r=ff(e),ps[n]=r),r):null}var ys=mt(ls.allocUnsafe)?function(t){if(!Nt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return ls.allocUnsafe(t)}:function(t){if(!Nt(t))throw new TypeError(N("invalid argument. Must provide a nonnegative integer. Value: `%s`.",t));return new ls(t)};function ms(t){return function(t,e,r,n){var i;return function(t,e){return"function"==typeof t["fill"]}(t)?t.fill(e,r,n):(r<0&&(r+=t.length)<0&&(r=0),n<0?n+=t.length:n>t.length&&(n=t.length),(i=Yn(t)).accessorProtocol?function(t,e,r,n){var i,o,a;for(i=t.data,o=t.accessors[1],a=r;a1&&(e.length=Rs(r,e,1,t,r>2)),e}function Is(t,e,r,n,i,o){var a,u,f,s,l;for(a=t.length,u=1,l=0;l=u&&(i=u-1);else if("wrap"===o)i<0?(i+=u)<0&&0!==(i%=u)&&(i+=u):i>=u&&(i-=u)>=u&&(i%=u);else if("normalize"===o&&i<0&&(i+=u),i<0||i>=u)throw new RangeError(N("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",u,i));if(f=r,Gn(n)){for(l=0;l=0;l--)i-=s=i%t[l],i/=t[l],f+=s*e[l];return f}var Bs=3;function Fs(t,e,r,n){var i,o,a,u,f,s,l;if(t<=0)return e;if((u=Yn(e)).accessorProtocol)return function(t,e,r,n){var i,o,a,u,f,s,l,c;for(i=e.data,a=e.accessors[0],o=e.accessors[1],l=It(t/2),s=(f=n)+(t-1)*r,c=0;c0)for(l=0;l=0&&t.length