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 86e611a..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/count-truthy) 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 90efbf0..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/count-truthy) 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 776420c..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: '25 13 * * 1'
-
- # 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 f4575e9..0000000
--- a/.github/workflows/productionize.yml
+++ /dev/null
@@ -1,794 +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 status to Slack channel if job fails:
- - name: 'Send status to Slack channel in case of failure'
- # Pin action to full length commit SHA
- uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
- with:
- status: ${{ job.status }}
- channel: '#npm-ci'
- if: failure()
-
- # 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 countTruthy = require( '@stdlib/ndarray-count-truthy' );
+If no recognized module system is present, access bundle contents via the global scope:
+
+```html
+
```
#### countTruthy( x\[, options] )
@@ -221,8 +227,13 @@ var v = ndarray2array( y );
-```javascript
-var bernoulli = require( '@stdlib/random-base-bernoulli' ).factory;
+```html
+
+
+
+
+
+
+
```
@@ -370,7 +386,7 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors].
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/ndarray-count-truthy/main/LICENSE
-[@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.1d.js b/benchmark/benchmark.1d.js
deleted file mode 100644
index 4e441ce..0000000
--- a/benchmark/benchmark.1d.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );
-var pow = require( '@stdlib/math-base-special-pow' );
-var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
-var shape2strides = require( '@stdlib/ndarray-base-shape2strides' );
-var ndarray = require( '@stdlib/ndarray-ctor' );
-var pkg = require( './../package.json' ).name;
-var countTruthy = require( './../lib' );
-
-
-// VARIABLES //
-
-var types = [ 'float64' ];
-var orders = [ 'row-major', 'column-major' ];
-
-
-// FUNCTIONS //
-
-/**
-* Creates a benchmark function.
-*
-* @private
-* @param {PositiveInteger} len - ndarray length
-* @param {NonNegativeIntegerArray} shape - ndarray shape
-* @param {string} xtype - ndarray data type
-* @param {string} order - memory layout
-* @param {NonNegativeIntegerArray} dims - list of dimensions to reduce
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype, order, dims ) {
- var x;
-
- x = discreteUniform( len, 1, 100 );
- x = new ndarray( xtype, x, shape, shape2strides( shape, order ), 0, order );
-
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = countTruthy( x, {
- 'dims': dims
- });
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an ndarray' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var dims;
- var len;
- var min;
- var max;
- var ord;
- var sh;
- var t1;
- var f;
- var i;
- var j;
- var k;
- var n;
- var d;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- d = [
- [ 0 ],
- []
- ];
-
- for ( n = 0; n < d.length; n++ ) {
- dims = d[ n ];
- for ( k = 0; k < orders.length; k++ ) {
- ord = orders[ k ];
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len ];
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
- }
- }
- }
- }
-}
-
-main();
diff --git a/benchmark/benchmark.2d.js b/benchmark/benchmark.2d.js
deleted file mode 100644
index 10ca405..0000000
--- a/benchmark/benchmark.2d.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
-* @license Apache-2.0
-*
-* Copyright (c) 2025 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 isndarrayLike = require( '@stdlib/assert-is-ndarray-like' );
-var pow = require( '@stdlib/math-base-special-pow' );
-var sqrt = require( '@stdlib/math-base-special-sqrt' );
-var floor = require( '@stdlib/math-base-special-floor' );
-var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
-var shape2strides = require( '@stdlib/ndarray-base-shape2strides' );
-var ndarray = require( '@stdlib/ndarray-ctor' );
-var pkg = require( './../package.json' ).name;
-var countTruthy = require( './../lib' );
-
-
-// VARIABLES //
-
-var types = [ 'float64' ];
-var orders = [ 'row-major', 'column-major' ];
-
-
-// FUNCTIONS //
-
-/**
-* Creates a benchmark function.
-*
-* @private
-* @param {PositiveInteger} len - ndarray length
-* @param {NonNegativeIntegerArray} shape - ndarray shape
-* @param {string} xtype - ndarray data type
-* @param {string} order - memory layout
-* @param {NonNegativeIntegerArray} dims - list of dimensions to reduce
-* @returns {Function} benchmark function
-*/
-function createBenchmark( len, shape, xtype, order, dims ) {
- var x;
-
- x = discreteUniform( len, 1, 100 );
- x = new ndarray( xtype, x, shape, shape2strides( shape, order ), 0, order );
-
- return benchmark;
-
- /**
- * Benchmark function.
- *
- * @private
- * @param {Benchmark} b - benchmark instance
- */
- function benchmark( b ) {
- var out;
- var i;
-
- b.tic();
- for ( i = 0; i < b.iterations; i++ ) {
- out = countTruthy( x, {
- 'dims': dims
- });
- if ( typeof out !== 'object' ) {
- b.fail( 'should return an ndarray' );
- }
- }
- b.toc();
- if ( !isndarrayLike( out ) ) {
- b.fail( 'should return an ndarray' );
- }
- b.pass( 'benchmark finished' );
- b.end();
- }
-}
-
-
-// MAIN //
-
-/**
-* Main execution sequence.
-*
-* @private
-*/
-function main() {
- var dims;
- var len;
- var min;
- var max;
- var ord;
- var sh;
- var t1;
- var f;
- var i;
- var j;
- var k;
- var n;
- var d;
-
- min = 1; // 10^min
- max = 6; // 10^max
-
- d = [
- [ 0, 1 ],
- [ 0 ],
- [ 1 ],
- []
- ];
-
- for ( n = 0; n < d.length; n++ ) {
- dims = d[ n ];
- for ( k = 0; k < orders.length; k++ ) {
- ord = orders[ k ];
- for ( j = 0; j < types.length; j++ ) {
- t1 = types[ j ];
- for ( i = min; i <= max; i++ ) {
- len = pow( 10, i );
-
- sh = [ len/2, 2 ];
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
-
- sh = [ 2, len/2 ];
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
-
- len = floor( sqrt( len ) );
- sh = [ len, len ];
- len *= len;
- f = createBenchmark( len, sh, t1, ord, dims );
- bench( pkg+':ndims='+sh.length+',len='+len+',shape=['+sh.join(',')+'],xorder='+ord+',xtype='+t1+',dims=['+dims.join(',' )+']', f );
- }
- }
- }
- }
-}
-
-main();
diff --git a/branches.md b/branches.md
deleted file mode 100644
index 3681c1d..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/count-truthy"
-%% click B href "https://github.com/stdlib-js/ndarray-count-truthy/tree/main"
-%% click C href "https://github.com/stdlib-js/ndarray-count-truthy/tree/production"
-%% click D href "https://github.com/stdlib-js/ndarray-count-truthy/tree/esm"
-%% click E href "https://github.com/stdlib-js/ndarray-count-truthy/tree/deno"
-%% click F href "https://github.com/stdlib-js/ndarray-count-truthy/tree/umd"
-```
-
-[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/count-truthy
-[production-url]: https://github.com/stdlib-js/ndarray-count-truthy/tree/production
-[deno-url]: https://github.com/stdlib-js/ndarray-count-truthy/tree/deno
-[deno-readme]: https://github.com/stdlib-js/ndarray-count-truthy/blob/deno/README.md
-[umd-url]: https://github.com/stdlib-js/ndarray-count-truthy/tree/umd
-[umd-readme]: https://github.com/stdlib-js/ndarray-count-truthy/blob/umd/README.md
-[esm-url]: https://github.com/stdlib-js/ndarray-count-truthy/tree/esm
-[esm-readme]: https://github.com/stdlib-js/ndarray-count-truthy/blob/esm/README.md
\ No newline at end of file
diff --git a/browser.js b/browser.js
new file mode 100644
index 0000000..6c080bd
--- /dev/null
+++ b/browser.js
@@ -0,0 +1,3 @@
+// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
+!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).countTruthy=t()}(this,(function(){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null;var t=Object.defineProperty;function e(r){return"number"==typeof r}function n(r){var t,e="";for(t=0;t0&&(t-=1),n=o.toExponential(t)):n=o.toPrecision(r.precision),r.alternate||(n=h.call(n,v,"$1e"),n=h.call(n,m,"e"),n=h.call(n,y,""));break;default:throw new Error("invalid double notation. Value: "+r.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),r.alternate&&(n=h.call(n,d,"$1."),n=h.call(n,g,"$1.e")),o>=0&&r.sign&&(n=r.sign+n),n=r.specifier===l.call(r.specifier)?l.call(n):u.call(n)}function b(r){var t,e="";for(t=0;t127)throw new Error("invalid character code. Value: "+n.arg);n.arg=T(a)?String(n.arg):_(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":t||(n.precision=6),n.arg=w(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=o(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(c=n.arg,p=n.width,d=n.padRight,g=void 0,(g=p-c.length)<0?c:c=d?c+b(g):b(g)+c)),s+=n.arg||"",u+=1}return s}var R=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function V(r){var t={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(t.precision="1"),t}function O(r){var t,e,n,o;for(e=[],o=0,n=R.exec(r);n;)(t=r.slice(o,R.lastIndex-n[0].length)).length&&e.push(t),e.push(V(n)),o=R.lastIndex,n=R.exec(r);return(t=r.slice(o)).length&&e.push(t),e}function S(r){var t,e;if("string"!=typeof r)throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[O(r)],e=1;eo&&(n=!1),!n&&!t)return 0;o=i}return n&&t?3:n?1:2}function lr(r,t){return t&&(2===r||3===r)}function hr(r,t){return t&&(1===r||3===r)}function cr(r,t,e){var n,o,i,a,f;for(n=r.length,o=e,i=e,f=0;f0?i+=a*(r[f]-1):a<0&&(o+=a*(r[f]-1))}return[o,i]}function pr(r){return r.re}function dr(r){return r.im}function gr(r){return"string"==typeof r}N(cr,"assign",(function(r,t,e,n){var o,i,a,f,s;for(o=r.length,i=e,a=e,s=0;s0?a+=f*(r[s]-1):f<0&&(i+=f*(r[s]-1))}return n[0]=i,n[1]=a,n}));var yr=String.prototype.valueOf;var mr=Y();function vr(r){return"object"==typeof r&&(r instanceof String||(mr?function(r){try{return yr.call(r),!0}catch(r){return!1}}(r):"[object String]"===$(r)))}function wr(r){return gr(r)||vr(r)}N(wr,"isPrimitive",gr),N(wr,"isObject",vr);var br=/[-\/\\^$*+?.()|[\]{}]/g;var _r=/./,Er=er(),Tr=Er.document&&Er.document.childNodes,xr=Int8Array;function Ar(){return/^\s*function\s*([^(]*)/i}var Rr=/^\s*function\s*([^(]*)/i;N(Ar,"REGEXP",Rr);var Vr=Array.isArray?Array.isArray:function(r){return"[object Array]"===$(r)};function Or(r){return null!==r&&"object"==typeof r}var Sr=function(r){if("function"!=typeof r)throw new TypeError(S("invalid argument. Must provide a function. Value: `%s`.",r));return function(t){var e,n;if(!Vr(t))return!1;if(e=t.length,0===e)return!1;for(n=0;n=0&&"/"!==r[e];e--);return void 0===e||e<=0?r.replace(br,"\\$&"):(t=(t=r.substring(1,e)).replace(br,"\\$&"),r=r[0]+t+r.substring(e))}(t),"g");else if(!Mr(t))throw new TypeError(S("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",t));if(!gr(e)&&!Pr(e))throw new TypeError(S("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",e));return Fr(r,t,e)}var Cr={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}} ] )"};var kr="function"==typeof Uint8Array;var Yr="function"==typeof Uint8Array?Uint8Array:null;var Dr,zr="function"==typeof Uint8Array?Uint8Array:void 0;Dr=function(){var r,t,e;if("function"!=typeof Yr)return!1;try{t=new Yr(t=[1,3.14,-3.14,256,257]),e=t,r=(kr&&e instanceof Uint8Array||"[object Uint8Array]"===$(e))&&1===t[0]&&3===t[1]&&253===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?zr:function(){throw new Error("not implemented")};var Wr=Dr,Gr="function"==typeof Uint16Array;var Jr="function"==typeof Uint16Array?Uint16Array:null;var $r,Zr="function"==typeof Uint16Array?Uint16Array:void 0;$r=function(){var r,t,e;if("function"!=typeof Jr)return!1;try{t=new Jr(t=[1,3.14,-3.14,65536,65537]),e=t,r=(Gr&&e instanceof Uint16Array||"[object Uint16Array]"===$(e))&&1===t[0]&&3===t[1]&&65533===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?Zr:function(){throw new Error("not implemented")};var Kr,qr=$r,Xr={uint16:qr,uint8:Wr};(Kr=new Xr.uint16(1))[0]=4660;var Hr=52===new Xr.uint8(Kr.buffer)[0],Qr="function"==typeof ArrayBuffer;function rt(r){return Qr&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===$(r)}var tt="function"==typeof Float64Array;var et="function"==typeof Float64Array?Float64Array:null;var nt,ot="function"==typeof Float64Array?Float64Array:void 0;nt=function(){var r,t,e;if("function"!=typeof et)return!1;try{t=new et([1,3.14,-3.14,NaN]),e=t,r=(tt&&e instanceof Float64Array||"[object Float64Array]"===$(e))&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){r=!1}return r}()?ot:function(){throw new Error("not implemented")};var it=nt,at="function"==typeof ArrayBuffer?ArrayBuffer:null;var ft,st="function"==typeof ArrayBuffer?ArrayBuffer:void 0;ft=function(){var r,t,e;if("function"!=typeof at)return!1;try{(r=rt(e=new at(16))&&"function"==typeof at.isView)&&((t=new it(e))[0]=-3.14,t[1]=NaN,r=r&&at.isView(t)&&16===e.byteLength&&-3.14===t[0]&&t[1]!=t[1])}catch(t){r=!1}return r}()?st:function(){throw new Error("not implemented")};var ut=ft,lt="function"==typeof DataView;var ht="function"==typeof DataView?DataView:null;var ct,pt="function"==typeof DataView?DataView:void 0;ct=function(){var r,t,e,n;if("function"!=typeof ht)return!1;try{e=new ut(24),t=new ht(e,8),n=t,(r=(lt&&n instanceof DataView||"[object DataView]"===$(n))&&"function"==typeof t.getFloat64&&"function"==typeof t.setFloat64)&&(t.setFloat64(0,-3.14),t.setFloat64(8,NaN),r=r&&t.buffer===e&&16===t.byteLength&&8===t.byteOffset&&-3.14===t.getFloat64(0)&&t.getFloat64(8)!=t.getFloat64(8))}catch(t){r=!1}return r}()?pt:function(){throw new Error("not implemented")};var dt=ct,gt="function"==typeof BigInt?BigInt:void 0,yt={all:["binary","bool","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"],typed:["binary","bool","complex64","complex128","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],floating_point:["complex64","complex128","float32","float64"],real_floating_point:["float32","float64"],complex_floating_point:["complex64","complex128"],boolean:["bool"],integer:["int16","int32","int8","uint16","uint32","uint8","uint8c"],signed_integer:["int16","int32","int8"],unsigned_integer:["uint16","uint32","uint8","uint8c"],real:["float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],numeric:["complex64","complex128","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"]},mt=/_and_generic$/;function vt(){var r,t,e;return 0===arguments.length?yt.all.slice():(e=!1,r=arguments[0],mt.test(r)&&"all"!==(r=Fr(r,mt,""))&&(e=!0),t=(t=yt[r])?t.slice():[],e&&t.length>0&&t.push("generic"),t)}function wt(){return{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256}}function bt(r,t,e){F(r,t,{configurable:!1,enumerable:!0,writable:!1,value:e})}function _t(r){return Object.keys(Object(r))}var Et,Tt=void 0!==Object.keys;function xt(r){return"[object Arguments]"===$(r)}Et=function(){return xt(arguments)}();var At=Et;function Rt(r){return"number"==typeof r}var Vt=Number,Ot=Vt.prototype.toString;var St=Y();function It(r){return"object"==typeof r&&(r instanceof Vt||(St?function(r){try{return Ot.call(r),!0}catch(r){return!1}}(r):"[object Number]"===$(r)))}function jt(r){return Rt(r)||It(r)}function Bt(r){return r!=r}function Pt(r){return Rt(r)&&Bt(r)}function Lt(r){return It(r)&&Bt(r.valueOf())}function Ut(r){return Pt(r)||Lt(r)}N(jt,"isPrimitive",Rt),N(jt,"isObject",It),N(Ut,"isPrimitive",Pt),N(Ut,"isObject",Lt);var Mt=Number.POSITIVE_INFINITY,Ft=Vt.NEGATIVE_INFINITY,Nt=Math.floor;function Ct(r){return Nt(r)===r}function kt(r){return rFt&&Ct(r)}function Yt(r){return Rt(r)&&kt(r)}function Dt(r){return It(r)&&kt(r.valueOf())}function zt(r){return Yt(r)||Dt(r)}N(zt,"isPrimitive",Yt),N(zt,"isObject",Dt);var Wt=Object.prototype.propertyIsEnumerable;var Gt=!Wt.call("beep","0");function Jt(r,t){var e;return null!=r&&(!(e=Wt.call(r,t))&&Gt&&wr(r)?!Pt(t=+t)&&Yt(t)&&t>=0&&t=0&&r.length<=$t&&W(r,"callee")&&!Jt(r,"callee")},Kt=Array.prototype.slice;var qt=Jt((function(){}),"prototype"),Xt=!Jt({toString:null},"toString"),Ht=9007199254740991;function Qt(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ct(r.length)&&r.length>=0&&r.length<=Ht}function re(r,t,e){var n,o;if(!Qt(r)&&!gr(r))throw new TypeError(S("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(0===(n=r.length))return-1;if(3===arguments.length){if(!Yt(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));if(e>=0){if(e>=n)return-1;o=e}else(o=n+e)<0&&(o=0)}else o=0;if(Ut(t)){for(;o0&&!W(r,"0"))for(f=0;f>>0,o=Nt(r/Ee),Hr?(xe.setUint32(0,i,Hr),xe.setUint32(4,o,Hr)):(xe.setUint32(0,o,Hr),xe.setUint32(4,i,Hr)),a=0;a>>0,n=Nt(r/4294967296),e=new dt(t.buffer),Hr?(e.setUint32(0,o,Hr),e.setUint32(4,n,Hr)):(e.setUint32(0,n,Hr),e.setUint32(4,o,Hr))),t}),"assign",Ae);var Re={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},Ve=de(),Oe={throw:1,clamp:2,wrap:3,normalize:4};function Se(r,t,e,n,o,i){var a,f,s,u,l;if(!(this instanceof Se))return new Se(r,t,e,n,o,i);for(u=1,l=0;l=0;a--)r-=i=r%e[a],r/=e[a],o+=i*t[a];return this._accessors?this._buffer.get(o):this._buffer[o]})),N(Se.prototype,"set",(function(){var r,t;for(r=this._offset,t=0;t=0;f--)r-=a=r%n[f],r/=n[f],i+=a*e[f];return this._accessors?this._buffer.set(t,i):this._buffer[i]=t,this})),N(Se.prototype,"toString",(function(){var r,t,e,n,o,i;if(t=this._shape.length,e="ndarray( '"+(n=this._dtype)+"', ",r="",this._length<=100)if("complex64"===n||"complex128"===n)for(i=0;i=0;i--)r+=pr(o=this.iget(this._length-1-i))+", "+dr(o),i>0&&(r+=", ");else for(i=2;i>=0;i--)r+=this.iget(this._length-1-i),i>0&&(r+=", ")}if(e+=Nr(Cr[this.dtype],"{{data}}",r),e+=", ",e+=0===t?"[]":"[ "+this._shape.join(", ")+" ]",e+=", ",e+="[ ",0===t)e+="0";else for(i=0;i=0;o--)e[o]=n,n*=r[o];return e}(r)}N(Ge,"assign",(function(r,t,e){return"column-major"===t?function(r,t){var e,n;for(e=1,n=0;n=0;n--)t[n]=e,e*=r[n];return t}(r,e)}));var Je="row-major";function $e(r,t){var e,n,o;return"object"!=typeof(o=r.strides)||null===o?0===(n=r.shape).length?[0]:("string"!=typeof(e=r.order)&&(e=Je),Ge(n,e)):t?ze(o):o}function Ze(r,t){var e,n,o;for(n=r.length,e=0,o=0;ot?-1:r}function en(r,t){var e,n,o,i;for(e={},n=[],i=0;i=0}function Nn(r){return Dt(r)&&r.valueOf()>=0}function Cn(r){return Fn(r)||Nn(r)}N(Cn,"isPrimitive",Fn),N(Cn,"isObject",Nn);var kn=4294967295;function Yn(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&Ct(r.length)&&r.length>=0&&r.length<=kn}function Dn(r){return"object"==typeof r&&null!==r&&!Vr(r)}function zn(r,t){if(!(this instanceof zn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Rt(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Rt(t))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return F(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),F(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:t}),this}N(zn,"BYTES_PER_ELEMENT",8),N(zn.prototype,"BYTES_PER_ELEMENT",8),N(zn.prototype,"byteLength",16),N(zn.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(zn.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Wn="function"==typeof Math.fround?Math.fround:null,Gn=new hn(1);var Jn="function"==typeof Wn?Wn:function(r){return Gn[0]=r,Gn[0]};function $n(r,t){if(!(this instanceof $n))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Rt(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Rt(t))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return F(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Jn(r)}),F(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Jn(t)}),this}function Zn(r){return r instanceof zn||r instanceof $n||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Kn(r){return Ct(r/2)}N($n,"BYTES_PER_ELEMENT",4),N($n.prototype,"BYTES_PER_ELEMENT",4),N($n.prototype,"byteLength",8),N($n.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N($n.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var qn=8;function Xn(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===qn}var Hn=16;function Qn(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Hn}function ro(){return"function"==typeof G&&"symbol"==typeof G("foo")&&W(G,"iterator")&&"symbol"==typeof G.iterator}var to=ro()?Symbol.iterator:null;function eo(r,t){if(!(this instanceof eo))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Rt(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Rt(t))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return F(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Jn(r)}),F(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Jn(t)}),this}function no(r){return r.re}function oo(r){return r.im}function io(r,t){return new hn(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}function ao(r,t){return new it(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}function fo(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Yn(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Zn(n))return new TypeError(S("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));t.push(no(n),oo(n))}return t}N(eo,"BYTES_PER_ELEMENT",4),N(eo.prototype,"BYTES_PER_ELEMENT",4),N(eo.prototype,"byteLength",8),N(eo.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(eo.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var so=2*hn.BYTES_PER_ELEMENT,uo=ro();function lo(r){return r instanceof po||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function ho(r){return r===po||"Complex128Array"===r.name}function co(r,t){return new eo(r[t*=2],r[t+1])}function po(){var r,t,e,n;if(t=arguments.length,!(this instanceof po))return 0===t?new po:1===t?new po(arguments[0]):2===t?new po(arguments[0],arguments[1]):new po(arguments[0],arguments[1],arguments[2]);if(0===t)e=new hn(0);else if(1===t)if(Fn(arguments[0]))e=new hn(2*arguments[0]);else if(Qt(arguments[0]))if((n=(e=arguments[0]).length)&&Vr(e)&&Zn(e[0])){if(e=function(r,t){var e,n,o,i;for(e=t.length,i=0,o=0;oe.byteLength-r)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*so));e=new hn(e,r,2*n)}}return N(this,"_buffer",e),N(this,"_length",e.length/2),this}function go(r,t){if(!(this instanceof go))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Rt(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Rt(t))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return F(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),F(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:t}),this}function yo(r){return r.re}function mo(r){return r.im}function vo(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(Yn(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!Zn(n))return new TypeError(S("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));t.push(yo(n),mo(n))}return t}N(po,"BYTES_PER_ELEMENT",so),N(po,"name","Complex64Array"),N(po,"from",(function(r){var t,e,n,o,i,a,f,s,u,l,h,c;if(!Pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ho(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Pr(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(lo(r)){if(s=r.length,n){for(i=(o=new this(s))._buffer,c=0,h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Qt(r)){if(n){for(s=r.length,f=r.get&&r.set?Le("default"):Ne("default"),h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dn(r)&&uo&&Pr(r[to])){if(!Pr((i=r[to]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Yn(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Zn(i))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));n.push(no(i),oo(i))}return n}(i,n,t):fo(i),a instanceof Error)throw a;for(i=(o=new this(s=a.length/2))._buffer,h=0;h=this._length))return co(this._buffer,r)})),or(po.prototype,"buffer",(function(){return this._buffer.buffer})),or(po.prototype,"byteLength",(function(){return this._buffer.byteLength})),or(po.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(po.prototype,"BYTES_PER_ELEMENT",po.BYTES_PER_ELEMENT),N(po.prototype,"copyWithin",(function(r,t){if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),N(po.prototype,"entries",(function(){var r,t,e,n,o,i,a;if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,n=this._length,i=-1,a=-2,N(e={},"next",(function(){var t;if(i+=1,o||i>=n)return{done:!0};return t=new eo(r[a+=2],r[a+1]),{value:[i,t],done:!1}})),N(e,"return",(function(r){if(o=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),to&&N(e,to,(function(){return t.entries()})),e})),N(po.prototype,"every",(function(r,t){var e,n;if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ct(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=no(r),f=oo(r),s=t;s=0;n--)if(o=co(e,n),r.call(t,o,n,this))return o})),N(po.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(o=co(e,n),r.call(t,o,n,this))return n;return-1})),N(po.prototype,"forEach",(function(r,t){var e,n,o;if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return co(this._buffer,r)})),N(po.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Zn(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=no(r),i=oo(r),e=this._buffer,a=t;a1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=no(r),i=oo(r),e=this._buffer,a=t;a1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=no(r),i=oo(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),or(po.prototype,"length",(function(){return this._length})),N(po.prototype,"map",(function(r,t){var e,n,o,i,a;if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(o=new this.constructor(this._length))._buffer,i=0;i1)n=t,i=0;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=co(e,0),i=1}for(;i1){if(!Fn(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Zn(r)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=no(r),void(n[e+1]=oo(r))}if(lo(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,u=n.byteOffset+e*so,t.buffer===n.buffer&&t.byteOffsetu){for(o=new hn(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,u=n.byteOffset+e*so,t.buffer===n.buffer&&t.byteOffsetu){for(o=new hn(a),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,s=0;sf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*so):(o=t-r,e=n.byteOffset+r*so),new this.constructor(n.buffer,e,o<0?0:o)})),N(po.prototype,"toReversed",(function(){var r,t,e,n,o,i;if(!lo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=new this.constructor(e),n=this._buffer,r=t._buffer,o=0;o=o)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Zn(t))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=no(t),e[2*r+1]=oo(t),n})),N(go,"BYTES_PER_ELEMENT",8),N(go.prototype,"BYTES_PER_ELEMENT",8),N(go.prototype,"byteLength",16),N(go.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),N(go.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var wo=2*it.BYTES_PER_ELEMENT,bo=ro();function _o(r){return r instanceof xo||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Eo(r){return r===xo||"Complex64Array"===r.name}function To(r,t){return new go(r[t*=2],r[t+1])}function xo(){var r,t,e,n;if(t=arguments.length,!(this instanceof xo))return 0===t?new xo:1===t?new xo(arguments[0]):2===t?new xo(arguments[0],arguments[1]):new xo(arguments[0],arguments[1],arguments[2]);if(0===t)e=new it(0);else if(1===t)if(Fn(arguments[0]))e=new it(2*arguments[0]);else if(Qt(arguments[0]))if((n=(e=arguments[0]).length)&&Vr(e)&&Zn(e[0])){if(e=function(r,t){var e,n,o,i;for(e=t.length,i=0,o=0;oe.byteLength-r)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*wo));e=new it(e,r,2*n)}}return N(this,"_buffer",e),N(this,"_length",e.length/2),this}N(xo,"BYTES_PER_ELEMENT",wo),N(xo,"name","Complex128Array"),N(xo,"from",(function(r){var t,e,n,o,i,a,f,s,u,l,h,c;if(!Pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Eo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Pr(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(_o(r)){if(s=r.length,n){for(i=(o=new this(s))._buffer,c=0,h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Qt(r)){if(n){for(s=r.length,f=r.get&&r.set?Le("default"):Ne("default"),h=0;h=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));i[c]=l[0],i[c+1]=l[1]}c+=2}return o}return new this(r)}if(Dn(r)&&bo&&Pr(r[to])){if(!Pr((i=r[to]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,t,e){var n,o,i,a;for(n=[],a=-1;!(o=r.next()).done;)if(a+=1,Yn(i=t.call(e,o.value,a))&&i.length>=2)n.push(i[0],i[1]);else{if(!Zn(i))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",i));n.push(yo(i),mo(i))}return n}(i,n,t):vo(i),a instanceof Error)throw a;for(i=(o=new this(s=a.length/2))._buffer,h=0;h=this._length))return To(this._buffer,r)})),or(xo.prototype,"buffer",(function(){return this._buffer.buffer})),or(xo.prototype,"byteLength",(function(){return this._buffer.byteLength})),or(xo.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),N(xo.prototype,"BYTES_PER_ELEMENT",xo.BYTES_PER_ELEMENT),N(xo.prototype,"copyWithin",(function(r,t){if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),N(xo.prototype,"entries",(function(){var r,t,e,n,o,i,a;if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,n=this._length,i=-1,a=-2,N(e={},"next",(function(){var t;if(i+=1,o||i>=n)return{done:!0};return t=new go(r[a+=2],r[a+1]),{value:[i,t],done:!1}})),N(e,"return",(function(r){if(o=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),to&&N(e,to,(function(){return t.entries()})),e})),N(xo.prototype,"every",(function(r,t){var e,n;if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=o)<0&&(t=0),arguments.length>2){if(!Ct(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=o)<0&&(e=0),e>o&&(e=o)}else e=o}else t=0,e=o;for(a=yo(r),f=mo(r),s=t;s=0;n--)if(o=To(e,n),r.call(t,o,n,this))return o})),N(xo.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(o=To(e,n),r.call(t,o,n,this))return n;return-1})),N(xo.prototype,"forEach",(function(r,t){var e,n,o;if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n=this._length))return To(this._buffer,r)})),or(xo.prototype,"length",(function(){return this._length})),N(xo.prototype,"includes",(function(r,t){var e,n,o,i,a;if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Zn(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=yo(r),i=mo(r),e=this._buffer,a=t;a1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(o=yo(r),i=mo(r),e=this._buffer,a=t;a1){if(!Ct(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(o=yo(r),i=mo(r),e=this._buffer,a=t;a>=0;a--)if(o===e[n=2*a]&&i===e[n+1])return a;return-1})),N(xo.prototype,"map",(function(r,t){var e,n,o,i,a;if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(o=new this.constructor(this._length))._buffer,i=0;i1)n=t,i=0;else{if(0===o)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=To(e,0),i=1}for(;i1){if(!Fn(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Zn(r)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=yo(r),void(n[e+1]=mo(r))}if(_o(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,u=n.byteOffset+e*wo,t.buffer===n.buffer&&t.byteOffsetu){for(o=new it(t.length),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,u=n.byteOffset+e*wo,t.buffer===n.buffer&&t.byteOffsetu){for(o=new it(a),s=0;sthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,s=0;sf&&(t=f)}}for(e=ro&&(t=o)}}return r>=o?(o=0,e=n.byteLength):r>=t?(o=0,e=n.byteOffset+r*wo):(o=t-r,e=n.byteOffset+r*wo),new this.constructor(n.buffer,e,o<0?0:o)})),N(xo.prototype,"toReversed",(function(){var r,t,e,n,o,i;if(!_o(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=new this.constructor(e),n=this._buffer,r=t._buffer,o=0;o=o)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Zn(t))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=yo(t),e[2*r+1]=mo(t),n}));var Ao=[it,hn,_n,yn,Rn,qr,Mn,Wr,jn,po,xo],Ro=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],Vo=Ro.length;function Oo(r){var t;if(Vr(r))return"generic";if(Ir(r))return null;for(t=0;t=0&&a=0&&!(((u=r[i])<0?-u:u)<=e);)r[i+1]=u,t[a+1]=t[a],i-=1,a-=1;r[i+1]=f,t[a+1]=s,n+=1,o+=1}}(t=ze(t),n),{sh:r=Lo(r,n),sx:t,sy:e=Lo(e,n)}}N(Bo,"assign",(function(r,t,e){var n=So(r);return n.accessorProtocol?"complex128"===n.dtype?Po(r,ao(r,0),t,e):"complex64"===n.dtype?Po(r,io(r,0),t,e):function(r,t,e){var n,o,i,a;for(n=r.data,o=r.accessors[1],a=e,i=0;a>=0&&a=0&&on?Mo.BLOCK_SIZE_IN_BYTES/e|0:Mo.BLOCK_SIZE_IN_BYTES/n|0}function No(r,t){var e,n;for(e=[],n=0;n1?arguments[1]:$o))return Co(r);if(e=function(r){return zo[r]||null}(t),null===e)throw new TypeError(S("invalid argument. Second argument must be a recognized data type. Value: `%s`.",t));return new e(r)}var Ko={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"};function qo(r){var t,e;for(t=[];!(e=r.next()).done;)t.push(Z(e.value));return t}var Xo=Wr.BYTES_PER_ELEMENT,Ho=ro();function Qo(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===Xo}function ri(r){return r===ti}function ti(){var r,t,e,n,o;if(t=arguments.length,!(this instanceof ti))return 0===t?new ti:1===t?new ti(arguments[0]):2===t?new ti(arguments[0],arguments[1]):new ti(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Wr(0);else if(1===t)if(Fn(o=arguments[0]))e=new Wr(o);else if(Qt(o))e=function(r,t){var e,n;for(e=t.length,n=0;ne.byteLength-r)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Xo));e=new Wr(e,r,n)}}return N(this,"_buffer",e),N(this,"_length",e.length),this}N(ti,"BYTES_PER_ELEMENT",Xo),N(ti,"name","BooleanArray"),N(ti,"from",(function(r){var t,e,n,o,i,a,f,s,u;if(!Pr(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ri(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((e=arguments.length)>1){if(!Pr(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(Qt(r)){if(n){for(s=r.length,f=r.get&&r.set?Le("default"):Ne("default"),i=(o=new this(s))._buffer,u=0;u=0;o--)if(n=Z(e[o]),r.call(t,n,o,this))return n})),N(ti.prototype,"findLastIndex",(function(r,t){var e,n,o;if(!Qo(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,o=this._length-1;o>=0;o--)if(n=Z(e[o]),r.call(t,n,o,this))return o;return-1})),N(ti.prototype,"get",(function(r){if(!Qo(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Fn(r))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return Z(this._buffer[r])})),or(ti.prototype,"length",(function(){return this._length})),N(ti.prototype,"map",(function(r,t){var e,n,o,i;if(!Qo(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Pr(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(o=this._buffer,e=(n=new this.constructor(this._length))._buffer,i=0;i1){if(!Fn(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(Qt(r)){if(e+(i=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=Qo(r)?r._buffer:r,f=n.byteOffset+e*Xo,t.buffer===n.buffer&&t.byteOffsetf){for(o=new Wr(t.length),a=0;a=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));n[e]=r?1:0}})),N(ti.prototype,"sort",(function(r){var t;if(!Qo(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(t=this._buffer,0===arguments.length)return t.sort(),this;if(!Pr(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));return t.sort((function(t,e){return r(Z(t),Z(e))})),this})),N(ti.prototype,"toReversed",(function(){var r,t,e,n,o;if(!Qo(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(e=this._length,t=new this.constructor(e),n=this._buffer,r=t._buffer,o=0;o0&&t.push("generic"),t)}var ui=ii(si("complex_floating_point")),li=ii(si("boolean"));function hi(r,t){if(Qn(r))return ao(r,t);if(Xn(r))return io(r,t);throw new TypeError(S("invalid argument. First argument must be a complex-valued floating-point array. Value: `%s`.",r))}function ci(r,t){return new Wr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,r.length-t)}function pi(r,t,e,n,o){var i,a;for(i=o,a=0;a=f&&(o=f-1);else if("wrap"===i)o<0?(o+=f)<0&&0!==(o%=f)&&(o+=f):o>=f&&(o-=f)>=f&&(o%=f);else if("normalize"===i&&o<0&&(o+=f),o<0||o>=f)throw new RangeError(S("invalid argument. Linear index must not exceed array dimensions. Number of array elements: `%u`. Value: `%d`.",f,o));if(s=e,"column-major"===n){for(l=0;l=0;l--)o-=u=o%r[l],o/=r[l],s+=u*t[l];return s}N(gi,"assign",di);var mi="throw";var vi="throw";var wi=[function(r,t,e){t[1].data[t[1].offset]=r(gi(t,1),e)},function(r,t,e,n,o){var i,a,f,s,u,l,h;for(f=(l=t[1]).shape[0],a=[n[0]],h=1;h0;){for(w0;){for(v0;){for(x0;){for(T0;){for(E0;){for(S0;){for(O0;){for(V0;){for(R0;){for(L0;){for(P0;){for(B0;){for(j0;){for(I0;){for(C0;){for(N0;){for(F0;){for(M0;){for(U0;){for(L0;){for(W0;){for(z0;){for(D0;){for(Y0;){for(k0;){for(C0;){for(N0;){for(K0;){for(Z0;){for($0;){for(J0;){for(G0;){for(W0;){for(z0;){for(D0;){for(rr0;){for(Q0;){for(H0;){for(X0;){for(q0;){for(K0;){for(Z0;){for($0;){for(J0;){for(ir0;){for(or0;){for(nr0;){for(er0;){for(tr0;){for(rr0;){for(Q0;){for(H0;){for(X0;){for(q0;){for(b0;){for(w0;){for(A0;){for(x0;){for(T0;){for(I0;){for(S0;){for(O0;){for(V0;){for(U0;){for(L0;){for(P0;){for(B0;){for(j0;){for(k0;){for(C0;){for(N0;){for(F0;){for(M0;){for(U0;){for(G0;){for(W0;){for(z0;){for(D0;){for(Y0;){for(k0;){for(C0;){for(q0;){for(K0;){for(Z0;){for($0;){for(J0;){for(G0;){for(W0;){for(z0;){for(tr0;){for(rr0;){for(Q0;){for(H0;){for(X0;){for(q0;){for(K0;){for(Z0;){for($0;){for(ar0;){for(ir0;){for(or0;){for(nr0;){for(er0;){for(tr0;){for(rr0;){for(Q0;){for(H0;){for(X3?n:{},T=t.length,s=[],O=0;Oi)throw new RangeError(S("invalid argument. Number of specified dimensions cannot exceed the number of dimensions in the input array. Number of dimensions: %d. Value: [%s].",i,jo(e,",")));for(A=i-x,O=1;O2?n:{};return xi(r,t,e,o)}}));var Ai=8,Ri=16;var Vi=1;var Oi=5;function Si(r,t,e,n){var o,i;if(r<=0||n<=0||1===t)return e;if(1===n){if((o=r%Oi)>0)for(i=0;i=0&&!(((u=r[i])<0?-u:u)<=e);)r[i+1]=u,t[a+1]=t[a],i-=1,a-=1;r[i+1]=f,t[a+1]=s,n+=1,o+=1}}(t=ze(t),e),{sh:r=Lo(r,e),sx:t,idx:e}}N(Si,"ndarray",(function(r,t,e,n,o){var i,a,f;if(r<=0||1===t)return e;if(i=o,1===n){if((a=r%5)>0)for(f=0;f0;)for(y0;)for(g0;)for(_0;)for(b0;)for(w0;)for(R0;)for(A0;)for(x0;)for(T0;)for(j0;)for(I0;)for(S0;)for(O0;)for(V0;)for(M0;)for(U0;)for(L0;)for(P0;)for(B0;)for(j0;)for(Y0;)for(k0;)for(C0;)for(N0;)for(F0;)for(M0;)for(U0;)for(J0;)for(G0;)for(W0;)for(z0;)for(D0;)for(Y0;)for(k0;)for(C0;)for(X0;)for(q0;)for(K0;)for(Z0;)for($0;)for(J0;)for(G0;)for(W0;)for(z0;)for(er0;)for(tr0;)for(rr0;)for(Q0;)for(H0;)for(X0;)for(q0;)for(K0;)for(Z0;)for($0;)for(m0;)for(y0;)for(E0;)for(_0;)for(b0;)for(V0;)for(R0;)for(A0;)for(x0;)for(B0;)for(j