diff --git a/.codespellrc b/.codespellrc
new file mode 100644
index 000000000..1a50d40d8
--- /dev/null
+++ b/.codespellrc
@@ -0,0 +1,2 @@
+[codespell]
+skip = ./node_modules*,./dist/*,./package-lock.json,./lib/srfi/*,./assets/UnicodeData.txt,./scripts/numerals.scm
diff --git a/.gitattributes b/.gitattributes
index 28f051899..77f2fe1f0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -7,3 +7,4 @@ assets/*.png binary
tests/snapshots/* binary
*.xcm binary
*.xcb binary
+dist/** linguist-generated
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 000000000..071ee4f13
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,35 @@
+name: Build and test
+
+on:
+ push:
+ branches:
+ - master
+ - devel
+ pull_request:
+ branches:
+ - master
+ - devel
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Update deps
+ run: sudo apt-get update
+ - name: Install ImageMagick
+ run: sudo apt-get -y install graphicsmagick
+ - name: checkout
+ uses: actions/checkout@v4
+ - name: setup node
+ uses: actions/setup-node@v3
+ with:
+ node-version: '16'
+ - run: npm ci
+ - run: make
+ - run: make lint
+ - run: make test
+ - run: make coverage
+ - name: Coveralls
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/codespell.yaml b/.github/workflows/codespell.yaml
new file mode 100644
index 000000000..344a6c1c8
--- /dev/null
+++ b/.github/workflows/codespell.yaml
@@ -0,0 +1,25 @@
+name: Codespell
+
+on:
+ push:
+ branches:
+ - master
+ - devel
+ pull_request:
+ branches:
+ - master
+ - devel
+
+permissions:
+ contents: read
+
+jobs:
+ codespell:
+ name: Check for spelling errors
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Codespell
+ uses: codespell-project/actions-codespell@v2
\ No newline at end of file
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
index 4d17cf9b4..76d9cfa51 100644
--- a/ARCHITECTURE.md
+++ b/ARCHITECTURE.md
@@ -7,7 +7,7 @@ Main interpreter data flow.
Main public function is `exec` that accept string (code) and Environment instance. If environment is not specified it use main user environment (same as lips.env) which is child of global environment.
`exec` use internal `parse` function that is JavaScript generator that parse single S-Expression and `exec` use `evaluate` to evaluate the expression.
-`evaluate` use multiple features like handling of Syntax, Macros and it auto resolve promises. `evaluate` may or may not return a promise. But `exec` always return a promise, so it's easier to use. You can never know which expression return a promise and which don't. `evaluate` also use `apply` function that was inspired by meta circual evaluator (but it was refactored into this state, it was not like this from beginning).
+`evaluate` use multiple features like handling of Syntax, Macros and it auto resolve promises. `evaluate` may or may not return a promise. But `exec` always return a promise, so it's easier to use. You can never know which expression return a promise and which don't. `evaluate` also use `apply` function that was inspired by meta circular evaluator (but it was refactored into this state, it was not like this from beginning).
## UML Diagram of all classes
@@ -16,7 +16,7 @@ Main public function is `exec` that accept string (code) and Environment instanc
## Lexer
Lexer is created as simple state machine with `Lexer._rules` that specify
-all the states. The sate change is simple it can change from null to given
+all the states. The state change is simple it can change from null to given
state for a given token (e.g. symbol), remain in same state and move from
given state to null. The last change produce new token. Rules are dynamic
the parser can be update by syntax extensions so `Lexer.rules` is a getter
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d9c07f29e..5f18aaaf2 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,26 @@
+## 1.0.0-beta.17
+### Breaking
+* chars are now not automatically unboxed to strings [#233](https://github.com/jcubic/lips/issues/233)
+### Features
+* make bookmark REPL dockable [#205](https://github.com/jcubic/lips/issues/205)
+* make Strings iterators that return characters
+* improve object literals [#237](https://github.com/jcubic/lips/issues/237)
+* better error message with exception on invalid string literal
+* add non-standard `with-input-from-string` function
+### Bugfix
+* fix using performance object for older version of Node
+* fixing escaped symbols in CodeMirror
+* fix parsing strings [#193](https://github.com/jcubic/lips/issues/193)
+* add proper error message to `-->` macro [#200](https://github.com/jcubic/lips/issues/200)
+* fix `performance.timeOrigin` on Node 12 [#207](https://github.com/jcubic/lips/issues/207)
+* fix string->list to handle longer code points
+* fix numerator and denominator [#213](https://github.com/jcubic/lips/issues/213)
+* fix Map object repr
+* fix parsing regular expressions [#238](https://github.com/jcubic/lips/issues/238)
+* fix exception when syntax-rule macro contain undefined
+* fix REPL clearing stdin when using read-line [#253](https://github.com/jcubic/lips/issues/253)
+* add proper handling of [Paste Brackets mode in REPL for NodeJS](https://github.com/nodejs/node/pull/47150)
+
## 1.0.0-beta.16
### Breaking
* replace `get-script` with `get-resource` that work in Node and in browser and allows to load CSS
@@ -16,6 +39,7 @@
* fix bug in `quasiquote` and `unquote-splicing` [#194](https://github.com/jcubic/lips/issues/194)
* fix `inexact->exact` on integers [#199](https://github.com/jcubic/lips/issues/199)
* throw error on missing parentheses [#198](https://github.com/jcubic/lips/issues/198)
+* fix empty syntax extensions as functions
## 1.0.0-beta.15
### Breaking
@@ -36,7 +60,7 @@
* property throw error when name is used without ellipsis
* fix using dot notation inside syntax-rules macros
* typecheck `string->symbol` and `symbol->string`
-* fix `parent.frame` inside `Intepreter`
+* fix `parent.frame` inside `Interpreter`
* fix `eval` without env
* fix quote as delimiter
* fix comma dot as two tokens
@@ -341,7 +365,7 @@
* `if` no longer require boolean as cond
* change how arrays are presented, they are look like scheme vector `#(...)`
* rename `string` to `repr`
-* new API `lips.Intepreter` - for using interpreter that have different stdout/stdin
+* new API `lips.Interpreter` - for using interpreter that have different stdout/stdin
* balanced_parenthesis now throw exception on broken code
* remove global env from public API (you can still access it using `env.parent`)
* remove `->` function (it will collide with SRFI 197 that may be implemented in the future)
@@ -374,7 +398,7 @@
* improve balancing parenthesis
* expose balanced method in public API (preferred name)
* optional brackets
-* `interator?` function and detection if iterators from `repr` and `type` [#51](https://github.com/jcubic/lips/issues/51)
+* `iterator?` function and detection if iterators from `repr` and `type` [#51](https://github.com/jcubic/lips/issues/51)
* `add-repr!` function to add string representations to objects
* new `string=?`, `sort`, `in`, `list-tail` and `bound?` functions
* add new `exit` function into executable interpreter
@@ -668,7 +692,7 @@
### Features
* new nth and reverse functions
* new type checking functions null? regex? pair? string? number? symbol? array? object? boolean?
-* add lips source code that throwed exception in JavaScript error message
+* add lips source code that threw exception in JavaScript error message
### Bug fixes
* fix lambda with rest parameter
### Breaking
diff --git a/LICENSE b/LICENSE
index 674012dd0..d3bec0007 100644
--- a/LICENSE
+++ b/LICENSE
@@ -71,7 +71,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
-Part of the library (contentloaded function) licesed with
+Part of the library (contentloaded function) licensed with
Copyright (c) 2005-2010 Diego Perini and NWBOX S.a.s.
diff --git a/Makefile b/Makefile
index 2b803f500..d125f760e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: publish test coveralls lint zero
+.PHONY: publish test coveralls lint zero coverage
VERSION=1.0.0-beta.16
VERSION_DASH=`echo -n "1.0.0-beta.16" | sed "s/-/%E2%80%93/"`
@@ -65,10 +65,10 @@ assets/classDiagram.svg: assets/classDiagram
README.md: templates/README.md dist/lips.js .$(VERSION)
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e \
- "s/{{VER_DASH}}/$(VERSION_DASH)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{CHECKSUM}}/$(TESTS_CHECKSUM)/g" \
+ "s/{{VER_DASH}}/$(VERSION_DASH)/g" -e "s#{{BRANCH}}#$(BRANCH)#g" -e "s/{{CHECKSUM}}/$(TESTS_CHECKSUM)/g" \
-e "s/{{YEAR}}/${YEAR}/g" -e "s/{{DATE}}/${DATE_SHORT}/" -e "s/{{COMMIT}}/$(COMMIT)/g" \
< templates/README.md > README.md || \
- $(SED) -e "s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{YEAR}}/${YEAR}/g" \
+ $(SED) -e "s/{{VER}}/$(VERSION)/g" -e "s#{{BRANCH}}#$(BRANCH)#g" -e "s/{{YEAR}}/${YEAR}/g" \
-e "s/{{CHECKSUM}}/$(TESTS_CHECKSUM)/g" -e "s/{{COMMIT}}/$(COMMIT)/g" -e "s/{{DATE}}/${DATE_SHORT}/" \
-e "s/{{VER_DASH}}/$(VERSION_DASH)/g" < templates/README.md > README.md
@@ -112,7 +112,7 @@ watch-lint:
watch-make:
@inotifywait -m -e close_write src/lips.js | while read even; do $(MAKE) --no-print-directory; done
-coveralls:
+coverage:
$(NPM) run coverage
lint:
diff --git a/README.md b/README.md
index 19e53e7bc..cf544d763 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
-
[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.16-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
![1.0.0 Complete](https://img.shields.io/github/milestones/progress-percent/jcubic/lips/1?label=1.0.0%20Complete)
-[![travis](https://travis-ci.com/jcubic/lips.svg?branch=master&aba7442b3be9483ca14039700e619680b8a73c37)](https://travis-ci.com/github/jcubic/lips)
-[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=master&1abe29427d5cfaa14ca0afda5bb5d3b4)](https://coveralls.io/github/jcubic/lips?branch=master)
+[![Build and test](https://github.com/jcubic/lips/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/lips/actions/workflows/build.yaml)
+[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&1eb2cfbcb9a646f24938a31ec46bbc33)](https://coveralls.io/github/jcubic/lips?branch=devel)
[![Join Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jcubic/lips)
![NPM Download Count](https://img.shields.io/npm/dm/@jcubic/lips)
![JSDelivr Download count](https://img.shields.io/jsdelivr/npm/hm/@jcubic/lips)
@@ -79,7 +79,7 @@ https://github.com/jcubic/lips/blob/master/lib/js/bookmark.js
```
Create any link in your bookmarks, edit it and copy paste the content of that file.
-Affter you click on the link it will create the REPL at the bottom of the page.
+After you click on the link it will create the REPL at the bottom of the page.
(NOTE: It may not work on every page because of content security policy;
e.g. google.com or gihub.com)
@@ -160,7 +160,7 @@ npm install -g @jcubic/lips@beta
you can run the interpreter from the terminal:
-![LIPS: Scheme interactive terminal](https://github.com/jcubic/lips/blob/master/assets/screencast.gif?raw=true)
+![LIPS: Scheme interactive terminal](https://github.com/jcubic/lips/blob/devel/assets/screencast.gif?raw=true)
You can also run code in a string with:
@@ -199,14 +199,14 @@ Executables also return a S-Expression according to SRFI-176 use `lips --version
## FOSDEM'23 Presentation [Video]
-[![FOSDEM 2023 - LIPS Scheme: Powerful introspection and extensibility](https://github.com/jcubic/lips/blob/master/assets/fosdem-intro.png?raw=true)](https://fosdem.org/2023/schedule/event/lipsscheme/)
+[![FOSDEM 2023 - LIPS Scheme: Powerful introspection and extensibility](https://github.com/jcubic/lips/blob/devel/assets/fosdem-intro.png?raw=true)](https://fosdem.org/2023/schedule/event/lipsscheme/)
## Limitations
Because LIPS is tree walking interpreter sometimes it may be slow. Especially if you want to
-process long arrays and use callback function. If the array is quite large each pice of code
+process long arrays and use callback function. If the array is quite large each piece of code
inside the callback may slow down the processing. For example see:
-script [reference.scm](https://github.com/jcubic/lips/blob/master/scripts/reference.scm)
+script [reference.scm](https://github.com/jcubic/lips/blob/devel/scripts/reference.scm)
That generates reference documentation for all builtin functions and macros.
The slow part is `(names.sort name-compare)` (`Array::sort`) that take quite time to calculate,
@@ -222,12 +222,12 @@ something like this:
(arr.sort fn))
```
-Another example of slow performace is using LIPS with React, the more code you put into components
+Another example of slow performance is using LIPS with React, the more code you put into components
the slower the app will become.
Examples:
* [Preact app that update SVG](https://codepen.io/jcubic/pen/PojYxBP) - it requires to use debounce.
-* [React with Hooks](https://codepen.io/jcubic/pen/PoKQmpq?editors=1000) - on click the UI freezes for ~300ms, you can see warnigs in dev tools.
+* [React with Hooks](https://codepen.io/jcubic/pen/PoKQmpq?editors=1000) - on click the UI freezes for ~300ms, you can see warnings in dev tools.
The issue with performance is tracked in [#197](https://github.com/jcubic/lips/issues/197).
diff --git a/REFERENCE.md b/REFERENCE.md
index 9f2073761..67c4a9096 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -5,7 +5,7 @@
(- n1 n2 ...)
(- n)
-Substract number passed as argument. If only one argument is passed
+Subtracts n2 and subsequent numbers from n1. If only one argument is passed
it will negate the value.
```
@@ -14,21 +14,21 @@ it will negate the value.
(. obj . args)
(get obj . args)
-Function use object as base and keep using arguments to get the
+This function uses an object as a base and keeps using arguments to get the
property of JavaScript object. Arguments need to be a strings.
-e.g. `(. console "log")` if you use any function inside LIPS is
-will be weakly bind (can be rebind), so you can call this log function
+e.g. `(. console "log")` if you use any function inside LIPS it
+will be weakly bound (can be rebound), so you can call this log function
without problem unlike in JavaScript when you use
`var log = console.log`.
-`get` is an alias because . don't work in every place, e.g. you can't
-pass it as argument.
+`get` is an alias because . doesn't work everywhere, e.g. you can't
+pass it as an argument.
```
## *
```
(* . numbers)
-Multiplicate all numbers passed as arguments. If single value is passed
+Multiplies all numbers passed as arguments. If single value is passed
it will return that value.
```
@@ -36,7 +36,7 @@ it will return that value.
```
(** a b)
-Function calculate number a to to the power of b.
+Function that calculates number a to to the power of b.
```
## /
@@ -44,29 +44,29 @@ Function calculate number a to to the power of b.
(/ n1 n2 ...)
(/ n)
-Divide number passed as arguments one by one. If single argument
-is passed it will calculate (/ 1 n1).
+Divides n1 by n2 and subsequent arguments one by one. If single argument
+is passed it will calculate (/ 1 n).
```
## &
```
(& a b)
-Function calculate and bit operation.
+Function that calculates the bitwise and operation.
```
## %
```
(% n1 n2)
-Function get reminder of it's arguments.
+Function returns the remainder of n1/n2 (modulo).
```
## +
```
(+ . numbers)
-Sum all numbers passed as arguments. If single value is passed it will
+Sums all numbers passed as arguments. If single value is passed it will
return that value.
```
@@ -74,95 +74,97 @@ return that value.
```
(< x1 x2 ...)
-Function compare its numerical arguments and check if they are
-monotonically decreasing
+Function that compares its numerical arguments and checks if they are
+monotonically increasing, i.e. x1 < x2 and x2 < x3 and so on.
```
## <<
```
(<< a b)
-Function left shit the value a by value b.
+Function that left shifts the value a by value b bits.
```
## <=
```
(<= x1 x2 ...)
-Function compare its numerical arguments and check if they are
-monotonically nonincreasing
+Function that compares its numerical arguments and checks if they are
+monotonically nondecreasing, i.e. x1 <= x2 and x2 <= x3 and so on.
```
## =
```
(== x1 x2 ...)
-Function compare its numerical arguments and check if they are equal
+Function that compares its numerical arguments and checks if they are
+all equal.
```
## ==
```
(== x1 x2 ...)
-Function compare its numerical arguments and check if they are equal
+Function that compares its numerical arguments and checks if they are
+all equal.
```
## >
```
-(> x1 x2 ...)
+(> x1 x2 x3 ...)
-Function compare its numerical arguments and check if they are
-monotonically increasing
+Function that compares its numerical arguments and checks if they are
+monotonically decreasing, i.e. x1 > x2 and x2 > x3 and so on.
```
## >=
```
(>= x1 x2 ...)
-Function compare its numerical arguments and check if they are
-monotonically nondecreasing
+Function that compares its numerical arguments and checks if they are
+monotonically nonincreasing, i.e. x1 >= x2 and x2 >= x3 and so on.
```
## >>
```
(>> a b)
-Function right shit the value a by value b.
+Function that right shifts the value a by value b bits.
```
## |
```
(| a b)
-Function calculate or bit operation.
+Function that calculates the bitwise or operation.
```
## ~
```
(~ number)
-Function negate the value.
+Function that calculates the bitwise inverse (flip all the bits).
```
## 1-
```
(1- number)
-Function substract 1 from the number and return result.
+Function that subtracts 1 from the number and return result.
```
## 1+
```
(1+ number)
-Function add 1 to the number and return result.
+Function that adds 1 to the number and return result.
```
## abs
```
(abs number)
-Function create absolute value from number.
+Function that returns the absolute value (magnitude) of number.
```
## acos
@@ -174,21 +176,21 @@ Function create absolute value from number.
```
(alist->assign alist . list-of-alists)
-Function that work like Object.assign but for LIPS alist.
+Function that works like Object.assign but for LIPS alists.
```
## alist->object
```
(alist->object alist)
-Function convert alist pairs to JavaScript object.
+Function that converts alist pairs to a JavaScript object.
```
## always
```
(always constant)
-Higher order function returns new function that always return given constant.
+Higher-order function that returns a new thunk that always returns the given constant when called.
```
## angle
@@ -202,16 +204,16 @@ Returns angle of the complex number in polar coordinate system.
```
(append item ...)
-Function will create new list with eac argument appended to the end.
-It will always return new list and not modify it's arguments.
+Function that creates a new list with each argument appended end-to-end.
+It will always return a new list and not modify its arguments.
```
## append!
```
(append! arg1 ...)
-Destructive version of append, it modify the list in place. It return
-new list where each argument is appened to the end. It may modify
+Destructive version of append, it can modify the lists in place. It returns
+a new list where each argument is appended to the end. It may modify
lists added as arguments.
```
@@ -219,14 +221,14 @@ lists added as arguments.
```
(apply fn list)
-Function that call function with list of arguments.
+Function that calls fn with the list of arguments.
```
## apropos
```
(apropos name)
-Search environment and display names that match the given name.
+Search the current environment and display names that match the given name.
name can be regex, string or symbol.
```
@@ -234,14 +236,14 @@ name can be regex, string or symbol.
```
(array->list array)
-Function convert JavaScript array to LIPS list.
+Function that converts a JavaScript array to a LIPS cons list.
```
## array?
```
(array? expression)
-Function check if value is an arrray.
+Predicate that tests if value is an array.
```
## asin
@@ -253,21 +255,21 @@ Function check if value is an arrray.
```
(assoc obj alist)
-Function return pair from alist that match given key using equal? check.
+Returns pair from alist that match given key using equal? check.
```
## assq
```
(assq obj alist)
-Function return pair from alist that match given key using eq? check.
+Returns pair from a list that matches given key using eq? check.
```
## assv
```
(assv obj alist)
-Function return pair from alist that match given key using eqv? check.
+Returns pair from alist that match given key using eqv? check.
```
## atan
@@ -279,7 +281,7 @@ Function return pair from alist that match given key using eqv? check.
```
(await value)
-Function unquote quoted promise so it can be automagicaly evaluated (resolved
+Unquotes a quoted promise so it can be automagically evaluated (resolved
to its value).
```
@@ -287,35 +289,35 @@ to its value).
```
(binary fn)
-Function return new function with arguments limited to two.
+Returns a new function with arguments limited to two.
```
## binary-port?
```
(binary-port? port)
-Function test if argument is binary port.
+Function that tests if argument is binary port.
```
## boolean?
```
(boolean? x)
-Function return true if value is boolean.
+Returns true if value is boolean.
```
## boolean=?
```
(boolean=? b1 b2 ...)
-Function check if all arguments are boolean and if they are the same.
+Checks if all arguments are boolean and if they are the same.
```
## bound?
```
(bound? x [env])
-Function check if variable is defined in given environement or interaction environment
+Function that check if the variable is defined in the given environment, or interaction-environment
if not specified.
```
@@ -323,8 +325,8 @@ if not specified.
```
(buffer->u8vector bin)
-Cross platform function that can be used in both Node and Browser.
-It can be used together with %read-file or %read-binary-file and convert
+Cross platform function that can be used in both Node and browser.
+It can be used together with %read-file or %read-binary-file to convert
the result ArrayBuffer or Buffer to u8vector.
```
@@ -332,7 +334,7 @@ the result ArrayBuffer or Buffer to u8vector.
```
(u8vector v1 v2 ...)
-Create usigned 8-bit integer vector from give arguments.
+Create unsigned 8-bit integer vector (C unsigned char) from give arguments.
```
## bytevector-append
@@ -348,7 +350,7 @@ Create new bytevector u8vector that is created from joining each argument.
(bytevector-copy v start)
(bytevector-copy v start end)
-Function and return new vector from start to end. If no start and end is provided
+Returns a new vector from start to end. If no start and end is provided
whole vector is copied and returned.
```
@@ -366,238 +368,238 @@ starting at at.
```
(u8vector-length v)
-return length of usigned 8-bit integer vector.
+return length of unsigned 8-bit integer vector (C unsigned char).
```
## bytevector-u8-ref
```
(u8vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## bytevector-u8-set!
```
(u8vector-set! vector k)
-Function set value of usigned 8-bit integer vector at index k. If index is out of range it throw exception.
+Function set value of unsigned 8-bit integer vector (C unsigned char) at index k. If index is out of range it throw exception.
```
## bytevector?
```
(u8vector? x)
-Function return #t of argument is usigned 8-bit integer vector otherwise it return #f.
+Returns #t of argument is unsigned 8-bit integer vector (C unsigned char) otherwise it return #f.
```
## caaaaar
```
(caaaaar arg)
-Function calculate (car (car (car (car (car arg)))))
+Function that calculates (car (car (car (car (car arg)))))
```
## caaaadr
```
(caaaadr arg)
-Function calculate (car (car (car (car (cdr arg)))))
+Function that calculates (car (car (car (car (cdr arg)))))
```
## caaaar
```
(caaaar arg)
-Function calculate (car (car (car (car arg))))
+Function that calculates (car (car (car (car arg))))
```
## caaadar
```
(caaadar arg)
-Function calculate (car (car (car (cdr (car arg)))))
+Function that calculates (car (car (car (cdr (car arg)))))
```
## caaaddr
```
(caaaddr arg)
-Function calculate (car (car (car (cdr (cdr arg)))))
+Function that calculates (car (car (car (cdr (cdr arg)))))
```
## caaadr
```
(caaadr arg)
-Function calculate (car (car (car (cdr arg))))
+Function that calculates (car (car (car (cdr arg))))
```
## caaar
```
(caaar arg)
-Function calculate (car (car (car arg)))
+Function that calculates (car (car (car arg)))
```
## caadaar
```
(caadaar arg)
-Function calculate (car (car (cdr (car (car arg)))))
+Function that calculates (car (car (cdr (car (car arg)))))
```
## caadadr
```
(caadadr arg)
-Function calculate (car (car (cdr (car (cdr arg)))))
+Function that calculates (car (car (cdr (car (cdr arg)))))
```
## caadar
```
(caadar arg)
-Function calculate (car (car (cdr (car arg))))
+Function that calculates (car (car (cdr (car arg))))
```
## caaddar
```
(caaddar arg)
-Function calculate (car (car (cdr (cdr (car arg)))))
+Function that calculates (car (car (cdr (cdr (car arg)))))
```
## caadddr
```
(caadddr arg)
-Function calculate (car (car (cdr (cdr (cdr arg)))))
+Function that calculates (car (car (cdr (cdr (cdr arg)))))
```
## caaddr
```
(caaddr arg)
-Function calculate (car (car (cdr (cdr arg))))
+Function that calculates (car (car (cdr (cdr arg))))
```
## caadr
```
(caadr arg)
-Function calculate (car (car (cdr arg)))
+Function that calculates (car (car (cdr arg)))
```
## caar
```
(caar arg)
-Function calculate (car (car arg))
+Function that calculates (car (car arg))
```
## cadaaar
```
(cadaaar arg)
-Function calculate (car (cdr (car (car (car arg)))))
+Function that calculates (car (cdr (car (car (car arg)))))
```
## cadaadr
```
(cadaadr arg)
-Function calculate (car (cdr (car (car (cdr arg)))))
+Function that calculates (car (cdr (car (car (cdr arg)))))
```
## cadaar
```
(cadaar arg)
-Function calculate (car (cdr (car (car arg))))
+Function that calculates (car (cdr (car (car arg))))
```
## cadadar
```
(cadadar arg)
-Function calculate (car (cdr (car (cdr (car arg)))))
+Function that calculates (car (cdr (car (cdr (car arg)))))
```
## cadaddr
```
(cadaddr arg)
-Function calculate (car (cdr (car (cdr (cdr arg)))))
+Function that calculates (car (cdr (car (cdr (cdr arg)))))
```
## cadadr
```
(cadadr arg)
-Function calculate (car (cdr (car (cdr arg))))
+Function that calculates (car (cdr (car (cdr arg))))
```
## cadar
```
(cadar arg)
-Function calculate (car (cdr (car arg)))
+Function that calculates (car (cdr (car arg)))
```
## caddaar
```
(caddaar arg)
-Function calculate (car (cdr (cdr (car (car arg)))))
+Function that calculates (car (cdr (cdr (car (car arg)))))
```
## caddadr
```
(caddadr arg)
-Function calculate (car (cdr (cdr (car (cdr arg)))))
+Function that calculates (car (cdr (cdr (car (cdr arg)))))
```
## caddar
```
(caddar arg)
-Function calculate (car (cdr (cdr (car arg))))
+Function that calculates (car (cdr (cdr (car arg))))
```
## cadddar
```
(cadddar arg)
-Function calculate (car (cdr (cdr (cdr (car arg)))))
+Function that calculates (car (cdr (cdr (cdr (car arg)))))
```
## caddddr
```
(caddddr arg)
-Function calculate (car (cdr (cdr (cdr (cdr arg)))))
+Function that calculates (car (cdr (cdr (cdr (cdr arg)))))
```
## cadddr
```
(cadddr arg)
-Function calculate (car (cdr (cdr (cdr arg))))
+Function that calculates (car (cdr (cdr (cdr arg))))
```
## caddr
```
(caddr arg)
-Function calculate (car (cdr (cdr arg)))
+Function that calculates (car (cdr (cdr arg)))
```
## cadr
```
(cadr arg)
-Function calculate (car (cdr arg))
+Function that calculates (car (cdr arg))
```
## call-with-input-file
@@ -629,289 +631,290 @@ Proc is executed with given port and after it returns, the port is closed.
```
(call-with-values producer consumer)
-Calls its producer argument with no values and a continuation that,
-when passed some values, calls the consumer procedure with those
-values as arguments.
+Calls the producer procedure with no arguments, then calls the
+consumer procedure with the returned value as an argument -- unless
+the returned value is a special Values object created by (values), if it is
+the values are unpacked and the consumer is called with multiple arguments.
```
## car
```
(car pair)
-Function returns car (head) of the list/pair.
+This function returns the car (item 1) of the list.
```
## cdaaaar
```
(cdaaaar arg)
-Function calculate (cdr (car (car (car (car arg)))))
+Function that calculates (cdr (car (car (car (car arg)))))
```
## cdaaadr
```
(cdaaadr arg)
-Function calculate (cdr (car (car (car (cdr arg)))))
+Function that calculates (cdr (car (car (car (cdr arg)))))
```
## cdaaar
```
(cdaaar arg)
-Function calculate (cdr (car (car (car arg))))
+Function that calculates (cdr (car (car (car arg))))
```
## cdaadar
```
(cdaadar arg)
-Function calculate (cdr (car (car (cdr (car arg)))))
+Function that calculates (cdr (car (car (cdr (car arg)))))
```
## cdaaddr
```
(cdaaddr arg)
-Function calculate (cdr (car (car (cdr (cdr arg)))))
+Function that calculates (cdr (car (car (cdr (cdr arg)))))
```
## cdaadr
```
(cdaadr arg)
-Function calculate (cdr (car (car (cdr arg))))
+Function that calculates (cdr (car (car (cdr arg))))
```
## cdaar
```
(cdaar arg)
-Function calculate (cdr (car (car arg)))
+Function that calculates (cdr (car (car arg)))
```
## cdadaar
```
(cdadaar arg)
-Function calculate (cdr (car (cdr (car (car arg)))))
+Function that calculates (cdr (car (cdr (car (car arg)))))
```
## cdadadr
```
(cdadadr arg)
-Function calculate (cdr (car (cdr (car (cdr arg)))))
+Function that calculates (cdr (car (cdr (car (cdr arg)))))
```
## cdadar
```
(cdadar arg)
-Function calculate (cdr (car (cdr (car arg))))
+Function that calculates (cdr (car (cdr (car arg))))
```
## cdaddar
```
(cdaddar arg)
-Function calculate (cdr (car (cdr (cdr (car arg)))))
+Function that calculates (cdr (car (cdr (cdr (car arg)))))
```
## cdadddr
```
(cdadddr arg)
-Function calculate (cdr (car (cdr (cdr (cdr arg)))))
+Function that calculates (cdr (car (cdr (cdr (cdr arg)))))
```
## cdaddr
```
(cdaddr arg)
-Function calculate (cdr (car (cdr (cdr arg))))
+Function that calculates (cdr (car (cdr (cdr arg))))
```
## cdadr
```
(cdadr arg)
-Function calculate (cdr (car (cdr arg)))
+Function that calculates (cdr (car (cdr arg)))
```
## cdar
```
(cdar arg)
-Function calculate (cdr (car arg))
+Function that calculates (cdr (car arg))
```
## cddaaar
```
(cddaaar arg)
-Function calculate (cdr (cdr (car (car (car arg)))))
+Function that calculates (cdr (cdr (car (car (car arg)))))
```
## cddaadr
```
(cddaadr arg)
-Function calculate (cdr (cdr (car (car (cdr arg)))))
+Function that calculates (cdr (cdr (car (car (cdr arg)))))
```
## cddaar
```
(cddaar arg)
-Function calculate (cdr (cdr (car (car arg))))
+Function that calculates (cdr (cdr (car (car arg))))
```
## cddadar
```
(cddadar arg)
-Function calculate (cdr (cdr (car (cdr (car arg)))))
+Function that calculates (cdr (cdr (car (cdr (car arg)))))
```
## cddaddr
```
(cddaddr arg)
-Function calculate (cdr (cdr (car (cdr (cdr arg)))))
+Function that calculates (cdr (cdr (car (cdr (cdr arg)))))
```
## cddadr
```
(cddadr arg)
-Function calculate (cdr (cdr (car (cdr arg))))
+Function that calculates (cdr (cdr (car (cdr arg))))
```
## cddar
```
(cddar arg)
-Function calculate (cdr (cdr (car arg)))
+Function that calculates (cdr (cdr (car arg)))
```
## cdddaar
```
(cdddaar arg)
-Function calculate (cdr (cdr (cdr (car (car arg)))))
+Function that calculates (cdr (cdr (cdr (car (car arg)))))
```
## cdddadr
```
(cdddadr arg)
-Function calculate (cdr (cdr (cdr (car (cdr arg)))))
+Function that calculates (cdr (cdr (cdr (car (cdr arg)))))
```
## cdddar
```
(cdddar arg)
-Function calculate (cdr (cdr (cdr (car arg))))
+Function that calculates (cdr (cdr (cdr (car arg))))
```
## cddddar
```
(cddddar arg)
-Function calculate (cdr (cdr (cdr (cdr (car arg)))))
+Function that calculates (cdr (cdr (cdr (cdr (car arg)))))
```
## cdddddr
```
(cdddddr arg)
-Function calculate (cdr (cdr (cdr (cdr (cdr arg)))))
+Function that calculates (cdr (cdr (cdr (cdr (cdr arg)))))
```
## cddddr
```
(cddddr arg)
-Function calculate (cdr (cdr (cdr (cdr arg))))
+Function that calculates (cdr (cdr (cdr (cdr arg))))
```
## cdddr
```
(cdddr arg)
-Function calculate (cdr (cdr (cdr arg)))
+Function that calculates (cdr (cdr (cdr arg)))
```
## cddr
```
(cddr arg)
-Function calculate (cdr (cdr arg))
+Function that calculates (cdr (cdr arg))
```
## cdr
```
(cdr pair)
-Function returns cdr (tail) of the list/pair.
+This function returns the cdr (all but first) of the list.
```
## ceiling
```
(ceiling number)
-Function calculate ceiling of a number.
+Function that calculates the ceiling of a number.
```
## char->integer
```
(char->integer chr)
-Function return codepoint of Unicode character.
+Returns the codepoint of Unicode character.
```
## char-alphabetic?
```
(char-alphabetic? chr)
-Function return true if character is leter of the ASCII alphabet.
+Returns true if character is leter of the ASCII alphabet.
```
## char-ci
```
(char-ci chr1 chr2)
-Function return true if second character is smaller then the first one.
+Returns true if second character is smaller then the first one.
```
## char-ci<=?
```
(char-ci chr1 chr2)
-Function return true if second character is not larger then the first one.
+Returns true if second character is not larger then the first one.
```
## char-ci=?
```
(char-ci=? chr1 chr2)
-Function check if two characters are equal.
+Checks if two characters are equal.
```
## char-ci>?
```
(char-ci chr1 chr2)
-Function return true if second character is larger then the first one.
+Returns true if second character is larger then the first one.
```
## char-ci>=?
```
(char-ci chr1 chr2)
-Function return true if second character is not smaller then the first one.
+Returns true if second character is not smaller then the first one.
```
## char-downcase
@@ -925,14 +928,14 @@ Create lowercase version of the character.
```
(char-upper-case? char)
-Function check if character is lower case.
+Checks if character is lower case.
```
## char-numeric?
```
(char-numeric? chr)
-Function return true if character is number.
+Returns true if character is number.
```
## char-ready?
@@ -940,7 +943,7 @@ Function return true if character is number.
(char-ready?)
(char-ready? port)
-Function check it characters is ready in input port. This is usefull mostly
+Checks if characters is ready in input port. This is useful mostly
for interactive ports that return false if it would wait for user input.
It return false if port is closed.
```
@@ -956,63 +959,64 @@ Create uppercase version of the character.
```
(char-upper-case? char)
-Function check if character is upper case.
+Checks if character is upper case.
```
## char-whitespace?
```
(char-whitespace? chr)
-Function return true if character is whitespace.
+Returns true if character is whitespace.
```
## char?
```
(char? obj)
-Function check if object is character.
+Checks if the object is a character.
```
## char
```
(char chr1 chr2)
-Function return true if second character is smaller then the first one.
+Returns true if second character is smaller then the first one.
```
## char<=?
```
(char chr1 chr2)
-Function return true if second character is not larger then the first one.
+Returns true if second character is not larger then the first one.
```
## char=?
```
(char=? chr1 chr2)
-Function check if two characters are equal.
+Checks if two characters are equal.
```
## char>?
```
(char chr1 chr2)
-Function return true if second character is larger then the first one.
+Returns true if second character is larger then the first one.
```
## char>=?
```
(char chr1 chr2)
-Function return true if second character is not smaller then the first one.
+Returns true if second character is not smaller then the first one.
```
## clone
```
(clone list)
-Function return clone of the list.
+Function that returns a clone of the list, that does not share any pairs with the
+original, so the clone can be safely mutated without affecting the original.
```
## close-input-port
@@ -1038,11 +1042,18 @@ it no longer accept write to that port.
Close input or output port.
```
+## command-line
+```
+(command-line)
+
+Returns the command line arguments, or an empty list if not running under Node.js.
+```
+
## complement
```
(complement fn)
-Higer order function that returns complement of the given function. If the function fn
+Higher order function that returns the Boolean complement of the given function. If the function fn
for a given arguments return true the result function will return false, if it would
return false, the result function will return true.
```
@@ -1051,45 +1062,47 @@ return false, the result function will return true.
```
(complex? x)
-Function check if argument x is complex.
+Checks if argument x is complex.
```
## compose
```
(compose . fns)
-Higher order function and create new function that apply all functions
-From right to left and return it's value. Reverse of compose.
+Higher-order function that creates a new function that applies all functions
+from right to left and returns the last value. Reverse of pipe.
e.g.:
-((compose (curry + 2) (curry * 3)) 3)
-11
-
+((compose (curry + 2) (curry * 3)) 10) --> (+ 2 (* 3 10)) --> 32
```
## concat
```
(concat . strings)
-Function create new string by joining its arguments
+Function that creates a new string by joining its arguments.
```
## cons
```
(cons left right)
-Function return new Pair out of two arguments.
+This function returns a new list with the first appended
+before the second. If the second is not a list cons will
+return a dotted pair.
```
## cos
```
-#
+(cos n)
+
+Function that calculates cosine of a number.
```
## current-directory
```
(current-directory)
-Return corrent working directory, default it's path from where
+Returns the current working directory, default is the path from where
the script was executed.
```
@@ -1097,37 +1110,55 @@ the script was executed.
```
(current-environment)
-Function return current environement.
+Function that returns the current environment (they're first-class objects!)
```
## current-error-port
```
(current-output-port)
-Function return default stdout port.
+Returns the default stderr port.
```
## current-input-port
```
-current-input-port)
+(current-input-port)
+
+Returns the default stdin port.
+```
-Function return default stdin port.
+## current-jiffy
+```
+(current-jiffy)
+
+Return current jiffy. In LIPS is jiffy since start of the process.
+You can divide this value by (jiffies-per-second) to get seconds since
+start of the process. And you can add %%start-jiffy to get jiffy since
+January 1, 1970.
```
## current-output-port
```
(current-output-port)
-Function return default stdout port.
+Returns the default stdout port.
+```
+
+## current-second
+```
+(current-second)
+
+Functionn return exact integer of the seconds since January 1, 1970
```
## curry
```
(curry fn . args)
-Higher order function that create curried version of the function.
-The result function will have parially applied arguments and it
-will keep returning functions until all arguments are added
+Higher-order function that creates a curried version of the function.
+The result function will have partially applied arguments and it
+will keep returning one-argument functions until all arguments are provided,
+then it calls the original function with the accumulated arguments.
e.g.:
(define (add a b c d) (+ a b c d))
@@ -1140,28 +1171,30 @@ e.g.:
```
(debugger)
-Function stop JavaScript code in debugger.
+Function that triggers the JavaScript debugger (e.g. the browser devtools)
+using the "debugger;" statement. If a debugger is not running this
+function does nothing.
```
## defmacro?
```
(defmacro? expression)
-Function check if object is macro and it's expandable.
+Checks if object is a macro and it's expandable.
```
## degree->radians
```
(degree->radians x)
-Convert degree to radians.
+Convert degrees to radians.
```
## delete-file
```
(delete-file filename)
-Function delete the file of given name.
+Deletes the file of given name.
```
## denominator
@@ -1183,36 +1216,37 @@ or #f otherwise.
```
(dir obj)
-Function return all props on the object including those in prototype chain.
+Returns all props on the object including those in prototype chain.
```
## display
```
-(display arg [port])
+(display string [port])
-Function send string to standard output or provied port.
+This function outputs the string to the standard output or
+the port if given. No newline.
```
## display-error
```
(display-error . args)
-Display error message.
+Display an error message on stderr.
```
## dynamic-wind
```
(dynamic-wind before thunk after)
-Function accept 3 procedures/lambdas and execute thunk with before and always
-after even if error accur
+Accepts 3 procedures/lambdas and executes before, then thunk, and
+always after even if an error occurs in thunk.
```
## empty?
```
(empty? object)
-Function return true if value is undfined empty list.
+Function that returns #t if value is nil (an empty list) or undefined.
```
## env
@@ -1220,22 +1254,22 @@ Function return true if value is undfined empty list.
(env)
(env obj)
-Function return list of values (functions, macros and variables)
-inside environment and it's parents.
+Function that returns a list of names (functions, macros and variables)
+that are bound in the current environment or one of its parents.
```
## environment-bound?
```
(environment-bound? env symbol)
-Function check if symbol is bound variable similar to bound?.
+Checks if symbol is a bound variable similar to bound?.
```
## environment?
```
(environment? obj)
-Function check if object is LIPS environment.
+Checks if object is a LIPS environment.
```
## eof-object
@@ -1249,7 +1283,7 @@ Procedure returns eof object that indicate end of the port
```
(eof-object? arg)
-Function check if value is eof object, returned from input string
+Checks if value is eof object, returned from input string
port when there are no more data to read.
```
@@ -1257,23 +1291,23 @@ port when there are no more data to read.
```
(eq? a b)
-Function compare two values if they are identical.
+Function that compares two values if they are identical.
```
## equal?
```
(equal? a b)
-Function check if values are equal if both are pair or array
-it compares the their elements recursivly.
+The function checks if values are equal. If both are a pair or an array
+it compares their elements recursively.
```
## eqv?
```
(eqv? a b)
-Function compare the values. It return true if they are the same, they
-need to have same type
+Function that compares the values. It returns true if they are the same, they
+need to have the same type.
```
## error
@@ -1302,16 +1336,16 @@ Returns the message encapsulated by error-object.
```
(error-object? obj)
-Function check if object is of Error object throwed by error function.
+Checks if object is of Error object thrown by error function.
```
## escape-regex
```
(escape-regex string)
-Function return new string where all special operators used in regex,
-are escaped with slash so they can be used in RegExp constructor
-to match literal string
+Function that returns a new string where all special operators used in regex,
+are escaped with backslashes so they can be used in the RegExp constructor
+to match a literal string.
```
## eval
@@ -1319,29 +1353,31 @@ to match literal string
(eval expr)
(eval expr environment)
-Function evalute LIPS Scheme code.
+Function that evaluates LIPS Scheme code. If the second argument is provided
+it will be the environment that the code is evaluated in.
```
## even?
```
(even? number)
-Function check if number is even.
+Checks if number is even.
```
## every
```
(every fn list)
-Function call function fn on each item of the list, if every value is true
+Function that calls fn on each item of the list, if every value returns true
it will return true otherwise it return false.
+Analogous to Python all(map(fn, list)).
```
## exact
```
(inexact->exact number)
-Funcion convert real number to exact ratioanl number.
+Function that converts real number to exact rational number.
```
## exact->inexact
@@ -1355,7 +1391,7 @@ Convert exact number to inexact.
```
(exact-integer? n)
-Function returns #t if z is both exact and an integer; otherwise
+Returns #t if z is both exact and an integer; otherwise
returns #f.
```
@@ -1366,21 +1402,23 @@ returns #f.
## exp
```
-#
+(exp n)
+
+Function that calculates e raised to the power of n.
```
## expt
```
(** a b)
-Function calculate number a to to the power of b.
+Function that calculates number a to to the power of b.
```
## f32vector
```
(f32vector v1 v2 ...)
-Create 32-bit IEEE floating point number vector from give arguments.
+Create 32-bit IEEE-754 floating point number vector (C float) from give arguments.
```
## f32vector->list
@@ -1392,35 +1430,35 @@ Create 32-bit IEEE floating point number vector from give arguments.
```
(f32vector-length v)
-return length of 32-bit IEEE floating point number vector.
+return length of 32-bit IEEE-754 floating point number vector (C float).
```
## f32vector-ref
```
(f32vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## f32vector-set!
```
(f32vector-set! vector k)
-Function set value of 32-bit IEEE floating point number vector at index k. If index is out of range it throw exception.
+Function set value of 32-bit IEEE-754 floating point number vector (C float) at index k. If index is out of range it throw exception.
```
## f32vector?
```
(f32vector? x)
-Function return #t of argument is 32-bit IEEE floating point number vector otherwise it return #f.
+Returns #t of argument is 32-bit IEEE-754 floating point number vector (C float) otherwise it return #f.
```
## f64vector
```
(f64vector v1 v2 ...)
-Create 64-bit IEEE floating point number vector from give arguments.
+Create 64-bit IEEE-754 floating point number vector (C double) from give arguments.
```
## f64vector->list
@@ -1432,28 +1470,28 @@ Create 64-bit IEEE floating point number vector from give arguments.
```
(f64vector-length v)
-return length of 64-bit IEEE floating point number vector.
+return length of 64-bit IEEE-754 floating point number vector (C double).
```
## f64vector-ref
```
(f64vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## f64vector-set!
```
(f64vector-set! vector k)
-Function set value of 64-bit IEEE floating point number vector at index k. If index is out of range it throw exception.
+Function set value of 64-bit IEEE-754 floating point number vector (C double) at index k. If index is out of range it throw exception.
```
## f64vector?
```
(f64vector? x)
-Function return #t of argument is 64-bit IEEE floating point number vector otherwise it return #f.
+Returns #t of argument is 64-bit IEEE-754 floating point number vector (C double) otherwise it return #f.
```
## features
@@ -1471,9 +1509,9 @@ Function return #t of argument is 64-bit IEEE floating point number vector other
(filter fn list)
(filter regex list)
-Higher order function that call `fn` for each element of the list
-and return list for only those elements for which funtion return
-true value. If called with regex it will create matcher function.
+Higher-order function that calls `fn` for each element of the list
+and return a new list for only those elements for which fn returns
+a truthy value. If called with a regex it will create a matcher function.
```
## find
@@ -1481,29 +1519,29 @@ true value. If called with regex it will create matcher function.
(find fn list)
(find regex list)
-Higher order Function find first value for which function return true.
-If called with regex it will create matcher function.
+Higher-order function that finds the first value for which fn return true.
+If called with a regex it will create a matcher function.
```
## finite?
```
(finite? x)
-Function check if value is finite.
+Checks if value is finite.
```
## flatten
```
(flatten list)
-Return shallow list from tree structure (pairs).
+Returns a shallow list from tree structure (pairs).
```
## flip
```
(flip fn)
-Higher order function that return new function where first two arguments are swapped.
+Higher-order function that returns a new function where the first two arguments are swapped.
Example:
@@ -1516,7 +1554,7 @@ Example:
```
(floor number)
-Function calculate floor of a number.
+Function that calculates the floor of a number.
```
## floor-quotient
@@ -1534,11 +1572,19 @@ Function calculate floor of a number.
#
```
+## flush-output
+```
+(flush-output [port])
+
+If output-port is buffered, this causes the contents of its buffer to be written to
+the output device. Otherwise it has no effect. Returns an unspecified value.
+```
+
## flush-output-port
```
(flush-output-port port)
-Functio do nothing, flush is not needed in LIPS in both NodeJS and Browser.
+Function do nothing, flush is not needed in LIPS in both NodeJS and Browser.
The function is added, so it don't throw exception when using R7RS code.
```
@@ -1546,99 +1592,101 @@ The function is added, so it don't throw exception when using R7RS code.
```
(fold fn init . lists)
-Function fold is reverse of the reduce. it call function `fn`
-on each elements of the list and return single value.
-e.g. it call (fn a1 b1 (fn a2 b2 (fn a3 b3 '())))
-for: (fold fn '() alist blist)
+Function fold is left-to-right reversal of reduce. It call `fn`
+on each pair of elements of the list and returns a single value.
+e.g. it computes (fn 'a 'x (fn 'b 'y (fn 'c 'z 'foo)))
+for: (fold fn 'foo '(a b c) '(x y z))
```
## fold-left
```
(fold fn init . lists)
-Function fold is reverse of the reduce. it call function `fn`
-on each elements of the list and return single value.
-e.g. it call (fn a1 b1 (fn a2 b2 (fn a3 b3 '())))
-for: (fold fn '() alist blist)
+Function fold is left-to-right reversal of reduce. It call `fn`
+on each pair of elements of the list and returns a single value.
+e.g. it computes (fn 'a 'x (fn 'b 'y (fn 'c 'z 'foo)))
+for: (fold fn 'foo '(a b c) '(x y z))
```
## fold-right
```
(reduce fn init list . lists)
-Higher order function take each element of the list and call
-the function with result of previous call or init and next element
-on the list until each element is processed and return single value
+Higher-order function that takes each element of the list and calls
+the fn with result of previous call or init and the next element
+of the list until each element is processed, and returns a single value
as result of last call to `fn` function.
-e.g. it call (fn a3 b3 (fn a2 b2 (fn a1 b1 init)))
-for (reduce fn init alist blist)
+e.g. it computes (fn 'c 'z (fn 'b 'y (fn 'a 'x 'foo)))
+for: (reduce fn 'foo '(a b c) '(x y z))
```
## for-each
```
(for-each fn . lists)
-Higher order function that call function `fn` by for each
-value of the argument. If you provide more then one list as argument
+Higher-order function that calls function `fn` on each
+value of the argument. If you provide more than one list
it will take each value from each list and call `fn` function
-with that many argument as number of list arguments.
+with that many arguments as number of list arguments.
```
## force
```
(force promise)
-Function force the promise and evaluate delayed expression.
+Function that forces the promise and evaluates the delayed expression.
```
## format
```
(format string n1 n2 ...)
-Function accepts string template and replacing any escape sequences
-by arguments:
+This function accepts a string template and replaces any
+escape sequences in its inputs:
-* ~a value as if printed with display
-* ~s value as if printed with write
+* ~a value as if printed with `display`
+* ~s value as if printed with `write`
* ~% newline character
-* ~~ literal tilde '~' is inserted
+* ~~ literal tilde '~'
-if there missing arguments or other escape character it throw exception.
+If there are missing inputs or other escape characters it
+will error.
```
## function?
```
(function? expression)
-Function check if value is a function.
+Predicate that tests if value is a callable function.
```
## gcd
```
(gcd n1 n2 ...)
-Function return the greatest common divisor of their arguments.
+Function that returns the greatest common divisor of the arguments.
```
## gensym
```
(gensym)
-Function generate unique symbol, to use with macros as meta name.
+Generates a unique symbol that is not bound anywhere,
+to use with macros as meta name.
```
## gensym-interal
```
(gensym-interal symbol)
-Parser extension that create new quoted named gensym.
+Parser extension that creates a new quoted named gensym.
```
## gensym?
```
(gensym? value)
-Function return #t if value is symbol and it's gensym. It returns #f otherwise.
+Returns #t if value is a symbol created by gensym. It returns #f otherwise.
```
## get
@@ -1646,21 +1694,37 @@ Function return #t if value is symbol and it's gensym. It returns #f otherwise.
(. obj . args)
(get obj . args)
-Function use object as base and keep using arguments to get the
+This function uses an object as a base and keeps using arguments to get the
property of JavaScript object. Arguments need to be a strings.
-e.g. `(. console "log")` if you use any function inside LIPS is
-will be weakly bind (can be rebind), so you can call this log function
+e.g. `(. console "log")` if you use any function inside LIPS it
+will be weakly bound (can be rebound), so you can call this log function
without problem unlike in JavaScript when you use
`var log = console.log`.
-`get` is an alias because . don't work in every place, e.g. you can't
-pass it as argument.
+`get` is an alias because . doesn't work everywhere, e.g. you can't
+pass it as an argument.
+```
+
+## get-environment-variable
+```
+(get-environment-variable name)
+
+Returns given environment variable. This function throws exception
+when called in browser.
+```
+
+## get-environment-variables
+```
+(get-environment-variables)
+
+Returns all process environment variables as an alist. This function throws exception
+when called in browser.
```
## get-output-bytevector
```
(get-output-string port)
-Function get full string from string port. If nothing was wrote
+Gets full string from string port. If nothing was wrote
to given port it will return empty string.
```
@@ -1668,22 +1732,23 @@ to given port it will return empty string.
```
(get-output-string port)
-Function get full string from string port. If nothing was wrote
+Gets full string from string port. If nothing was wrote
to given port it will return empty string.
```
-## get-script
+## get-resource
```
-(get-script url)
+(get-resource url)
-Load JavaScript file in browser by adding script tag to head of the current document.
+Load JavaScript or CSS file in browser by adding script/link tag to head of the current document.
+When called from Node it allow it allows to load JavaScript files only.
```
## http-get
```
(http-get url)
-Node.js Function that send HTTP Request and return string or
+Node.js function that sends a HTTP Request and returns a string or
binary Buffer object.
```
@@ -1691,7 +1756,7 @@ binary Buffer object.
```
(identity n)
-No op function. it just returns its argument.
+No-op function. It just returns its argument.
```
## imag-part
@@ -1705,14 +1770,15 @@ Return imaginary part of the complex number n.
```
(in key value)
-Function use is in operator to check if value is in object.
+Function that uses the Javascript "in" operator to check if key is
+a valid property in the value.
```
## indexed-db?
```
(indexed-db?)
-Function test if indexedDB is available.
+Function that tests if IndexedDB is available.
```
## inexact
@@ -1726,7 +1792,7 @@ Convert exact number to inexact.
```
(inexact->exact number)
-Funcion convert real number to exact ratioanl number.
+Function that converts real number to exact rational number.
```
## inexact?
@@ -1738,49 +1804,49 @@ Funcion convert real number to exact ratioanl number.
```
(infinite? x)
-Function check if value is infinite.
+Checks if value is infinite.
```
## input-port-open?
```
(input-port-open? port)
-Function check if argument is input-port and if you can read from it.
+Checks if argument is input-port and if you can read from it.
```
## input-port?
```
(input-port? arg)
-Function return true if argument is input port.
+Returns true if argument is input port.
```
## instanceof
```
(instanceof type obj)
-Function check of object is instance of object.
+Predicate that tests if the obj is an instance of type.
```
## integer->char
```
(integer->char chr)
-Function convert number argument to chararacter.
+Function that converts number argument to character.
```
## integer?
```
(integer? x)
-Function check if argument x is integer.
+Checks if the argument x is integer.
```
## interaction-environment
```
(interaction-environment)
-Function return interaction environement equal to lips.env can be overwritten,
+Returns the interaction environment equal to lips.env. This can be overwritten
when creating new interpreter with lips.Interpreter.
```
@@ -1788,57 +1854,63 @@ when creating new interpreter with lips.Interpreter.
```
(iterator? x)
- Function check if value is JavaScript iterator object
+ Checks if value is JavaScript iterator object.
+```
+
+## jiffies-per-second
+```
+#
```
## join
```
(join separator list)
-Function return string by joining elements of the list
+Function that returns a string by joining elements of the list using separator.
```
## key->string
```
(key->string symbol)
-If symbol is key it convert that to string - remove colon.
+If symbol is a keyword it converts that to string and removes the colon.
```
## key?
```
(key? symbol)
-Function check if symbol is key symbol, have colon as first character.
+Checks if symbol is a keyword (has a colon as first character).
```
## lcm
```
(lcm n1 n2 ...)
-Function return the least common multiple of their arguments.
+Function that returns the least common multiple of the arguments.
```
## length
```
(length expression)
-Function return length of the object, the object can be list
-or any object that have length property.
+Function that returns the length of the object. The object can be a LIPS
+list or any object that has a "length" property. Returns undefined if the
+length could not be found.
```
## list
```
(list . args)
-Function create new list out of its arguments.
+Function that creates a new list out of its arguments.
```
## list->array
```
(list->array list)
-Function convert LIPS list into JavaScript array.
+Function that converts a LIPS list into a JavaScript array.
```
## list->f32vector
@@ -1870,7 +1942,7 @@ Function convert LIPS list into JavaScript array.
```
(list->string _list)
-Function return string from list of characters.
+Returns a string from a list of characters.
```
## list->u16vector
@@ -1892,7 +1964,7 @@ Function return string from list of characters.
```
(list->array list)
-Function convert LIPS list into JavaScript array.
+Function that converts a LIPS list into a JavaScript array.
```
## list-copy
@@ -1907,14 +1979,14 @@ of the list are not copied, they are passed as is.
```
(list-match? predicate list)
-Function check if consecutive elements of the list match the predicate function.
+Checks if consecutive elements of the list match the predicate function.
```
## list-ref
```
(list-ref list n)
-Returns n element of a list.
+Returns n-th element of a list.
```
## list-tail
@@ -1928,8 +2000,8 @@ Returns the sublist of list obtained by omitting the first k elements.
```
(list? obj)
-Function test if value is proper linked list structure.
-The car of each pair can be any value. It return false on cycles."
+Predicate that tests if value is a proper linked list structure.
+The car of each pair can be any value. It returns false on cyclic lists."
```
## load
@@ -1937,8 +2009,8 @@ The car of each pair can be any value. It return false on cycles."
(load filename)
(load filename environment)
-Function fetch the file and evaluate its content as LIPS code,
-If second argument is provided and it's environment the evaluation
+Fetches the file (from disk or network) and evaluates its content as LIPS code.
+If the second argument is provided and it's an environment the evaluation
will happen in that environment.
```
@@ -1946,7 +2018,7 @@ will happen in that environment.
```
(log z)
-Funcntion calculates natural logarithm of z. Where argument can be
+Function that calculates natural logarithm of z where the argument can be
any number (including complex negative and rational).
If the value is 0 it return NaN.
```
@@ -1955,7 +2027,7 @@ If the value is 0 it return NaN.
```
(macro? expression)
-Function check if value is a macro.
+Predicate that tests if value is a macro.
```
## magnitude
@@ -1969,21 +2041,21 @@ Returns magnitude of the complex number in polar coordinate system.
```
(make-u8vector k fill)
-Allocate new usigned 8-bit integer vector of length k, with optional initial values.
+Allocate new unsigned 8-bit integer vector (C unsigned char) of length k, with optional initial values.
```
## make-f32vector
```
(make-f32vector k fill)
-Allocate new 32-bit IEEE floating point number vector of length k, with optional initial values.
+Allocate new 32-bit IEEE-754 floating point number vector (C float) of length k, with optional initial values.
```
## make-f64vector
```
(make-f64vector k fill)
-Allocate new 64-bit IEEE floating point number vector of length k, with optional initial values.
+Allocate new 64-bit IEEE-754 floating point number vector (C double) of length k, with optional initial values.
```
## make-list
@@ -2002,42 +2074,42 @@ Create new complex number from polar parameters.
```
(make-promise fn)
-Function create promise from a function.
+Function that creates a promise from a function.
```
## make-rectangular
```
(make-rectangular im re)
-Create complex number from imaginary and real part.
+Creates a complex number from imaginary and real part (a+bi form).
```
## make-s16vector
```
(make-s16vector k fill)
-Allocate new signed 16-bit integer vector of length k, with optional initial values.
+Allocate new signed 16-bit integer vector (C short) of length k, with optional initial values.
```
## make-s32vector
```
(make-s32vector k fill)
-Allocate new signed 32-bit integer vector of length k, with optional initial values.
+Allocate new signed 32-bit integer vector (C unsigned int) of length k, with optional initial values.
```
## make-s8vector
```
(make-s8vector k fill)
-Allocate new signed 8-bit integer vector of length k, with optional initial values.
+Allocate new signed 8-bit integer vector (C signed char) of length k, with optional initial values.
```
## make-string
```
(make-string k [char])
-Function return new string with k elements, if char is provied
+Returns new string with k elements. If char is provided
it's filled with that character.
```
@@ -2045,35 +2117,35 @@ it's filled with that character.
```
(make-tags expression)
-Function that return list structure of code with better syntax then raw LIPS
+Returns a list structure of code with better syntax then raw LIPS
```
## make-u16vector
```
(make-u16vector k fill)
-Allocate new usigned 16-bit integer vector of length k, with optional initial values.
+Allocate new unsigned 16-bit integer vector (C unsigned short) of length k, with optional initial values.
```
## make-u32vector
```
(make-u32vector k fill)
-Allocate new usigned 32-bit integer vector of length k, with optional initial values.
+Allocate new unsigned 32-bit integer vector (C int) of length k, with optional initial values.
```
## make-u8vector
```
(make-u8vector k fill)
-Allocate new usigned 8-bit integer vector of length k, with optional initial values.
+Allocate new unsigned 8-bit integer vector (C unsigned char) of length k, with optional initial values.
```
## make-vector
```
(make-vector n [fill])
-Create new vector with n empty elements. If fill is specified it will set
+Creates a new vector with n empty elements. If fill is specified it will set
all elements of the vector to that value.
```
@@ -2081,103 +2153,104 @@ all elements of the vector to that value.
```
(map fn . lists)
-Higher order function that call function `fn` by for each
-value of the argument. If you provide more then one list as argument
+Higher-order function that calls function `fn` with each
+value of the list. If you provide more then one list as argument
it will take each value from each list and call `fn` function
with that many argument as number of list arguments. The return
-values of the function call is acumulated in result list and
-returned by the call to map.
+values of the fn calls are accumulated in a result list and
+returned by map.
```
## match
```
(match pattern string)
-function return match object from JavaScript as list or #f if not match.
+Function that returns a match object from JavaScript as a list or #f if
+no match.
```
## max
```
(max n1 n2 ...)
-Return maximum of it's arguments.
+Returns the maximum of its arguments.
```
## member
```
(member obj list)
-Function return first object in the list that match using equal? function.
+Returns first object in the list that match using equal? function.
```
## memq
```
(memq obj list)
-Function return first object in the list that match using eq? function.
+Returns first object in the list that match using eq? function.
```
## memv
```
(memv obj list)
-Function return first object in the list that match using eqv? function.
+Returns first object in the list that match using eqv? function.
```
## min
```
(min n1 n2 ...)
-Return minimum of it's arguments.
+Returns the minimum of its arguments.
```
## modulo
```
(modulo a b)
-Function return modulo operation on it's argumennts.
+Returns modulo operation on its argumennts.
```
## n-ary
```
(n-ary n fn)
-Return new function that limit number of arguments to n.
+Returns a new function that limits the number of arguments to n.
```
## nan?
```
(nan? x)
-Function check if argument x is Not a Number (NaN) value.
+Checks if argument x is Not a Number (NaN) value.
```
## native-symbol?
```
(native-symbol? object)
-Function check if value is JavaScript symbol.
+Checks if value is JavaScript Symbol.
```
## native.number
```
(native.number obj)
-If argument is number it will convert to native number.
+If argument is a number it will convert it to a native number.
```
## negative?
```
(negative? x)
-Function check if number is smaller then 0
+Checks if the number is smaller then 0
```
## new
```
(new obj . args)
-Function create new JavaScript instance of an object.
+Function that creates new JavaScript instance of an object.
```
## new-library
@@ -2198,43 +2271,44 @@ Write newline character to standard output or given port
```
(not x)
-Function return true if value is false and false otherwise.
+Returns true if value is false and false otherwise.
```
## nth
```
(nth index obj)
-Function return nth element of the list or array. If used with different
-value it will throw exception
+Function that returns the nth element of the list or array.
+If used with a non-indexable value it will error.
```
## null-environment
```
(null-environment)
-Function return new base environment with std lib.
+Returns a clean environment with only the standard library.
```
## null?
```
(null? expression)
-Function check if value is nulish.
+Predicate that tests if value is null-ish (i.e. undefined, nil, or
+Javascript null).
```
## number->string
```
(number->string x [radix])
-Function convert number to string with optional radix (number base).
+Function that converts number to string with optional radix (number base).
```
## number?
```
(number? expression)
-Function check if value is a number or NaN value.
+Predicate that tests if value is a number or NaN value.
```
## numbers?
@@ -2246,47 +2320,54 @@ Function check if value is a number or NaN value.
```
(numerator n)
-Return numberator of rational or same number if n is not rational.
+Return numerator of rational or same number if n is not rational.
```
-## object-expander
+## object->alist
+```
+(object->alist object)
+
+Function that converts a JavaScript object to Alist
```
-(object-expander reaonly '(:foo (:bar 10) (:baz (1 2 3))))
-(object-expander reaonly '(:foo :bar))
+## object-expander
+```
+(object-expander readonly '(:foo (:bar 10) (:baz (1 2 3))))
+(object-expander readonly '(:foo :bar))
-Recursive function helper for defining LIPS code for create objects
-using key like syntax. if no values are used it will create JavaScript
-shorthand objects where keys are used for keys and values
+Recursive function helper for defining LIPS code to create objects
+using key like syntax. If no values are used it will create a JavaScript
+shorthand objects where keys are used for keys and the values.
```
## object?
```
(object? expression)
-Function check if value is an plain object.
+Predicate that tests if value is an plain object (not another LIPS type).
```
## odd?
```
(odd? number)
-Function check if number os odd.
+Checks if number is odd.
```
## once
```
(once fn)
-Higher order function that return new function, that is guarantee
-to be called only once.
+Higher-order function that returns a new function, that only calls the original
+on the first invocation, and immediately returns the first call's result again
+on subsequent invocations.
```
## open-binary-input-file
```
(open-binary-input-file filename)
-Function return new Input Binary Port with given filename. In Browser
+Returns new Input Binary Port with given filename. In Browser
user need to provide global fs variable that is instance of FS interface.
```
@@ -2294,7 +2375,7 @@ user need to provide global fs variable that is instance of FS interface.
```
(open-binary-output-file filename)
-Function open file and return port that can be used for writing. If file
+Opens file and return port that can be used for writing. If file
exists it will throw an Error.
```
@@ -2309,7 +2390,7 @@ Create new input binary port with given bytevector
```
(open-input-file filename)
-Function return new Input Port with given filename. In Browser user need to
+Returns new Input Port with given filename. In Browser user need to
provide global fs variable that is instance of FS interface.
```
@@ -2317,7 +2398,7 @@ provide global fs variable that is instance of FS interface.
```
(open-input-string string)
-Function create new string port as input that can be used to
+Creates new string port as input that can be used to
read S-exressions from this port using `read` function.
```
@@ -2334,7 +2415,7 @@ After done with the data the output buffer can be obtained by calling
```
(open-output-file filename)
-Function open file and return port that can be used for writing. If file
+Function that opens file and return port that can be used for writing. If file
exists it will throw an Error.
```
@@ -2342,7 +2423,7 @@ exists it will throw an Error.
```
(open-output-string)
-Function create new output port that can used to write string into
+Creates new output port that can used to write string into
and after finish get the whole string using `get-output-string`.
```
@@ -2350,52 +2431,53 @@ and after finish get the whole string using `get-output-string`.
```
(output-port-open? port)
-Function check if argument is output-port and if you can write to it.
+Checks if argument is output-port and if you can write to it.
```
## output-port?
```
(output-port? arg)
-Function return true if argument is output port.
+Returns true if argument is output port.
```
## pair-map
```
(pair-map fn list)
-Function call fn argument for pairs in a list and return combined list with
-values returned from function fn. It work like the map but take two items from list
+Function that calls fn argument for pairs in a list and returns a combined list with
+values returned from function fn. It works likes map but take two items from the list each time.
```
## pair?
```
(pair? expression)
-Function check if value is a pair or list structure.
+Predicate that tests if value is a pair or list structure.
```
## parent.frame
```
(parent.frame)
-Return parent environment if called from inside function.
-If no parent frame found it return nil.
+Returns the parent environment if called from inside a function.
+If no parent frame can be found it returns nil.
```
## parent.frames
```
(parent.frames)
-Funcion return list of environments from parent frames (lambda function calls)
+Returns the list of environments from parent frames (lambda function calls)
```
## peek-char
```
(peek-char port)
-Function get character from string port or EOF object if no more
-data in string port.
+This function reads and returns a character from the string
+port, or, if there is no more data in the string port, it
+returns an EOF.
```
## peek-u8
@@ -2411,86 +2493,88 @@ it return eof object.
```
(pipe . fns)
-Higher order function and create new function that apply all functions
-From left to right and return it's value. Reverse of compose.
+Higher-order function that creates a new function that applies all functions
+from left to right and returns the last value. Reverse of compose.
e.g.:
-((pipe (curry + 2) (curry * 3)) 3)
-15
+((pipe (curry + 2) (curry * 3)) 10) --> (* 3 (+ 2 10)) --> 36
```
## plain-object?
```
(plain-object? x)
-Function check if value is plain JavaScript object. Created using object macro.
+Checks if value is a plain JavaScript object created using the object macro.
```
## pluck
```
-(pluck . string)
+(pluck . strings)
-If called with single string it will return function that will return
-key from object. If called with more then one argument function will
-return new object by taking all properties from given object.
+If called with a single string it will return a function that when
+called with an object will return that key from the object.
+If called with more then one string the returned function will
+create a new object by copying all properties from the given object.
```
## port?
```
(port? x)
-Function return true of argumet is nput or output port port object.
+Returns true if the argument is an input or output port object.
```
## positive?
```
(positive? x)
-Function check if number is larger then 0
+Checks if the number is larger then 0
```
## pprint
```
(pprint expression)
-Pretty print list expression, if called with non-pair it just call
-print function with passed argument.
+This function will pretty print its input to stdout. If it is called
+with a non-list, it will just call the print function on its
+input.
```
## pretty-format
```
(pretty-format pair)
-Function return pretty printed string from pair expression.
+Returns a pretty printed string from pair expression.
```
## print
```
(print . args)
-Function convert each argument to string and print the result to
-standard output (by default it's console but it can be defined
-it user code), the function call newline after printing each arg.
+This function converts each input into a string and prints
+the result to the standard output (by default it's the
+console but it can be defined in user code). This function
+calls `(newline)` after printing each input.
```
## procedure?
```
(function? expression)
-Function check if value is a function.
+Predicate that tests if value is a callable function.
```
## promise?
```
(promise? obj)
-Function check if value is a promise created with delay or make-promise.
+Checks if the value is a promise created with delay or make-promise.
```
## promisify
```
(promisify fn)
-Simple function for adding promises to NodeJS callback based function.
+Simple function for adding promises to NodeJS two-callback based functions.
Function tested only with fs module.
```
@@ -2498,21 +2582,22 @@ Function tested only with fs module.
```
(prototype? obj)
-Function check if value is JavaScript Object prototype.
+Predicate that tests if value is a valid JavaScript prototype,
+i.e. calling (new) with it will not throw ' is not a constructor'.
```
## qsort
```
(qsort list predicate)
-Sort the list using quick sort alorithm according to predicate.
+Sorts the list using the quick sort algorithm according to predicate.
```
## quoted-symbol?
```
(quoted-symbol? code)
-Helper function that test if value is quoted symbol. To be used in macros
+Helper function that tests if value is a quoted symbol. To be used in macros
that pass literal code that is transformed by parser.
usage:
@@ -2528,7 +2613,7 @@ usage:
```
(quotient a b)
-Return quotient from divition as integer.
+Return quotient from division as integer.
```
## quotient&remainder
@@ -2540,14 +2625,14 @@ Return quotient from divition as integer.
```
(radians->degree x)
-Convert radians to degree.
+Convert radians to degrees.
```
## raise
```
(raise obj)
-Throws new exception with given object.
+Throws the object verbatim (no wrapping an a new Error).
```
## random
@@ -2555,28 +2640,32 @@ Throws new exception with given object.
(random)
(random seed)
-Function generate new random real number using Knuth algorithm.
+Function that generates new random real number using Knuth algorithm.
```
## range
```
-(range n)
+(range stop)
+(range start stop)
+(range start stop step)
-Function return list of n numbers from 0 to n - 1
+Returns a list of numbers from start to stop with optional step.
+If start is not defined it starts from 0. If start is larger than stop
+the step needs to be negative otherwise it will hang in an infinite loop.
```
## rational?
```
(rational? x)
-Function check if value is rational.
+Checks if the value is rational.
```
## rationalize
```
(rationalize number tolerance)
-Function returns simplest rational number differing from number by no more
+Returns simplest rational number approximation differing from number by no more
than the tolerance.
```
@@ -2584,12 +2673,13 @@ than the tolerance.
```
(read [string])
-Function if used with string will parse the string and return
-list structure of LIPS code. If called without an argument it
-will read string from standard input (using browser prompt or
-user defined way) and call itself with that string (parse is)
-function can be used together with eval to evaluate code from
-string
+This function, if used with a string, will parse it and
+return the LIPS code, if there is any. If called with a
+port, it will parse the next item from the port. If called
+without an input, it will read a string from standard input
+(using the browser's prompt or a user defined input method)
+and calls itself with that string. This function can be used
+together with `eval` to evaluate code from a string.
```
## read-bytevector
@@ -2609,7 +2699,7 @@ return the only bytes that are available
(read-bytevector! bytevector port start)
(read-bytevector! bytevector port start end)
-Function read next bytes from binary input port and write them into byte vector.
+Reads next bytes from binary input port and write them into byte vector.
if not start is specified it start to write into 0 position of the vector until
the end or end the vector if no end is specified.
```
@@ -2618,14 +2708,16 @@ the end or end the vector if no end is specified.
```
(read-char port)
-Function read next character from input port.
+This function reads and returns the next character from the
+input port.
```
## read-line
```
(read-char port)
-Function read next character from input port.
+This function reads and returns the next line from the input
+port.
```
## read-string
@@ -2660,76 +2752,79 @@ Return real part of the complex number n.
```
(real? x)
-Function check if argument x is real.
+Checks if the argument x is real.
```
## reduce
```
(reduce fn init list . lists)
-Higher order function take each element of the list and call
-the function with result of previous call or init and next element
-on the list until each element is processed and return single value
+Higher-order function that takes each element of the list and calls
+the fn with result of previous call or init and the next element
+of the list until each element is processed, and returns a single value
as result of last call to `fn` function.
-e.g. it call (fn a3 b3 (fn a2 b2 (fn a1 b1 init)))
-for (reduce fn init alist blist)
+e.g. it computes (fn 'c 'z (fn 'b 'y (fn 'a 'x 'foo)))
+for: (reduce fn 'foo '(a b c) '(x y z))
```
## regex?
```
(regex? x)
-Function return true of value is regular expression, it return false otherwise.
+Returns true if value is a regular expression, or false otherwise.
```
## remainder
```
(% n1 n2)
-Function get reminder of it's arguments.
+Function returns the remainder of n1/n2 (modulo).
```
## remainder__
```
(modulo a b)
-Function return reminder from division operation.
+Returns remainder from division operation.
```
## replace
```
(replace pattern replacement string)
-Function change pattern to replacement inside string. Pattern can be string
-or regex and replacement can be function or string.
+Function that changes pattern to replacement inside string. Pattern can be a
+string or regex and replacement can be function or string. See Javascript
+String.replace().
```
## repr
```
(repr obj)
-Function return string LIPS representation of an object as string.
+Function that returns a LIPS code representation of the object as a string.
```
## require
```
(require module)
-Function to be used inside Node.js to import the module.
+Function used inside Node.js to import a module.
```
## require.resolve
```
(require.resolve path)
-Return path relative the current module.
+Returns the path relative to the current module.
+
+Only available when LIPS is running under Node.js.
```
## reset
```
(reset)
-Function reset environment and remove all user defined variables.
+Function resets the environment and removes all user defined variables.
```
## response->buffer
@@ -2741,11 +2836,11 @@ Function reset environment and remove all user defined variables.
```
(response->text binary res)
-Function read all text from Node.js HTTP response object. If binary argument
+Reads all text from a Node.js HTTP response object. If binary argument
is true it will return Buffer object that can be converted to u8vector.
-***Warrning:*** it may overflow the stack (part of Node) when converting
-whole buffer to u8vector.
+***Warning:*** it may overflow the Javascript call stack when converting the
+whole buffer to u8vector, because LIPS doesn't have TCO.
```
## response->text
@@ -2757,22 +2852,22 @@ whole buffer to u8vector.
```
(reverse list)
-Function will reverse the list or array. If value is not a list
-or array it will throw exception.
+Function that reverses the list or array. If value is not a list
+or array it will error.
```
## round
```
(round number)
-Function calculate round of a number.
+Function that calculates the round of a number.
```
## s16vector
```
(s16vector v1 v2 ...)
-Create signed 16-bit integer vector from give arguments.
+Create signed 16-bit integer vector (C short) from give arguments.
```
## s16vector->list
@@ -2784,35 +2879,35 @@ Create signed 16-bit integer vector from give arguments.
```
(s16vector-length v)
-return length of signed 16-bit integer vector.
+return length of signed 16-bit integer vector (C short).
```
## s16vector-ref
```
(s16vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## s16vector-set!
```
(s16vector-set! vector k)
-Function set value of signed 16-bit integer vector at index k. If index is out of range it throw exception.
+Function set value of signed 16-bit integer vector (C short) at index k. If index is out of range it throw exception.
```
## s16vector?
```
(s16vector? x)
-Function return #t of argument is signed 16-bit integer vector otherwise it return #f.
+Returns #t of argument is signed 16-bit integer vector (C short) otherwise it return #f.
```
## s32vector
```
(s32vector v1 v2 ...)
-Create signed 32-bit integer vector from give arguments.
+Create signed 32-bit integer vector (C unsigned int) from give arguments.
```
## s32vector->list
@@ -2824,35 +2919,35 @@ Create signed 32-bit integer vector from give arguments.
```
(s32vector-length v)
-return length of signed 32-bit integer vector.
+return length of signed 32-bit integer vector (C unsigned int).
```
## s32vector-ref
```
(s32vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## s32vector-set!
```
(s32vector-set! vector k)
-Function set value of signed 32-bit integer vector at index k. If index is out of range it throw exception.
+Function set value of signed 32-bit integer vector (C unsigned int) at index k. If index is out of range it throw exception.
```
## s32vector?
```
(s32vector? x)
-Function return #t of argument is signed 32-bit integer vector otherwise it return #f.
+Returns #t of argument is signed 32-bit integer vector (C unsigned int) otherwise it return #f.
```
## s8vector
```
(s8vector v1 v2 ...)
-Create signed 8-bit integer vector from give arguments.
+Create signed 8-bit integer vector (C signed char) from give arguments.
```
## s8vector->list
@@ -2864,84 +2959,86 @@ Create signed 8-bit integer vector from give arguments.
```
(s8vector-length v)
-return length of signed 8-bit integer vector.
+return length of signed 8-bit integer vector (C signed char).
```
## s8vector-ref
```
(s8vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## s8vector-set!
```
(s8vector-set! vector k)
-Function set value of signed 8-bit integer vector at index k. If index is out of range it throw exception.
+Function set value of signed 8-bit integer vector (C signed char) at index k. If index is out of range it throw exception.
```
## s8vector?
```
(s8vector? x)
-Function return #t of argument is signed 8-bit integer vector otherwise it return #f.
+Returns #t of argument is signed 8-bit integer vector (C signed char) otherwise it return #f.
```
## scheme-report-environment
```
(scheme-report-environment version)
-Function return new Environment object for given Scheme Spec version.
-Only argument 5 is supported that create environemnt for R5RS.
+Returns new Environment object for given Scheme Spec version.
+Only argument 5 is supported that create environment for R5RS.
```
## search
```
(search pattern string)
-Function return first found index of the pattern inside a string
+Function that returns the first found index of the pattern inside a string.
```
## set-car!
```
(set-car! obj value)
-Function that set car (head) of the list/pair to specified value.
-It can destroy the list. Old value is lost.
+Function that sets the car (first item) of the list/pair to specified value.
+The old value is lost.
```
## set-cdr!
```
(set-cdr! obj value)
-Function that set cdr (tail) of the list/pair to specified value.
-It can destroy the list. Old value is lost.
+Function that sets the cdr (tail) of the list/pair to specified value.
+It will destroy the list. The old tail is lost.
```
## set-current-directory!
```
(set-current-directory! string)
-Function change current working directory to provided string.
+Changes the current working directory to provided string.
```
## set-obj!
```
(set-obj! obj key value)
+(set-obj! obj key value props)
-Function set property of JavaScript object
+Function set a property of a JavaScript object. props should be a vector of pairs,
+passed to Object.defineProperty.
```
## set-repr!
```
(add-repr! type fn)
-Function add string represention to the type, which should be constructor function.
+Function that adds the string representation to the type, which should be a constructor function.
-Function fn should have args (obj q) and it should return string, obj is vlaue that
-need to be converted to string, if the object is nested and you need to use `repr`,
-it should pass second parameter q to repr, so string will be quoted when it's true.
+Function fn should have args (obj q) and it should return a string. obj is the value that
+need to be converted to a string. If the object is nested and you need to use `repr` recursively,
+it should pass the second parameter q to repr, so string will be quoted when it's true.
e.g.: (lambda (obj q) (string-append "<" (repr obj q) ">"))
```
@@ -2950,40 +3047,45 @@ e.g.: (lambda (obj q) (string-append "<" (repr obj q) ">"))
```
(set-special! symbol name [type])
-Add special symbol to the list of transforming operators by the parser.
+Add a special symbol to the list of transforming operators by the parser.
e.g.: `(add-special! "#" 'x)` will allow to use `#(1 2 3)` and it will be
transformed into (x (1 2 3)) so you can write x macro that will process
-the list. 3rd argument is optional and it can be constant value
-lips.specials.SPLICE if this constant is used it will transform
-`#(1 2 3)` into (x 1 2 3) that is required by # that define vectors.
+the list. 3rd argument is optional, and it can be one of two values:
+lips.specials.LITERAL, which is the default behavior, or
+lips.specials.SPLICE which causes the value to be unpacked into the expression.
+This can be used for e.g. to make `#(1 2 3)` into (x 1 2 3) that is needed
+by # that defines vectors.
```
## sin
```
-#
+(sin n)
+
+Function that calculates sine of a number.
```
## single
```
(single list)
-Function check if argument is list with single element
+Checks if argument is list with one element.
```
## some
```
(some fn list)
-Higher order function that call argument on each element of the list.
-It stops when function fn return true for a value if so it will
-return true. If none of the values give true, the function return false
+Higher-order function that calls fn on each element of the list.
+It stops and returns true when fn returns true for a value.
+If none of the values give true, some will return false.
+Analogous to Python any(map(fn, list)).
```
## sort
```
(sort list [predicate])
-Sort the list using optional predicate function. if not function is specified
+Sorts the list using optional predicate function. If no comparison function is given
it will use <= and sort in increasing order.
```
@@ -2991,7 +3093,7 @@ it will use <= and sort in increasing order.
```
(split separator string)
-Function create list by splitting string by separatar that can
+Function that creates a list by splitting string by separator which can
be a string or regular expression.
```
@@ -2999,7 +3101,7 @@ be a string or regular expression.
```
(sqrt number)
-Function return square root of the number.
+Function that returns the square root of the number.
```
## square
@@ -3013,29 +3115,29 @@ Returns the square of z. This is equivalent to (* z z).
```
(string chr1 chr2 ...)
-Function create new string from it's arguments. Each argument
-Need to be a character object.
+Function that creates a new string from it's arguments. Each argument
+needs to be a character object.
```
## string->list
```
(string->list string)
-Function return list of characters created from string.
+Returns a list of characters created from string.
```
## string->number
```
(string->number number [radix])
-Function convert string to number.
+Function that parses a string into a number.
```
## string->symbol
```
(string->symbol string)
-Function convert string to LIPS symbol.
+Function that converts a string to a LIPS symbol.
```
## string->utf8
@@ -3044,7 +3146,7 @@ Function convert string to LIPS symbol.
(string->utf8 string start)
(string->utf8 string start end)
-Function converts string into u8 bytevector using utf8 encoding.
+Converts string into u8 bytevector using utf8 encoding.
The start and end is the range of the input string for the conversion.
```
@@ -3054,7 +3156,7 @@ The start and end is the range of the input string for the conversion.
(string->list string start)
(string->list string start end)
-Function copy given range of string to list. If no start is specified it use
+Function that copies given range of string to list. If no start is specified it use
start of the string, if no end is specified it convert to the end of the string.
```
@@ -3062,77 +3164,77 @@ start of the string, if no end is specified it convert to the end of the string.
```
(concat . strings)
-Function create new string by joining its arguments
+Function that creates a new string by joining its arguments.
```
## string-ci
```
(string-ci string1 string2)
-Function return true if second string is smaller then the first one.
+Returns true if the second string is smaller than the first one, ignoring case.
```
## string-ci<=?
```
(string-ci string1 string2)
-Function return true if second string is not larger then the first one.
+Returns true if the second string is not larger than the first one, ignoring case.
```
## string-ci=?
```
(string-ci=? string1 string2)
-Function check if two string s are equal.
+Checks if two strings are equal, ignoring case.
```
## string-ci>?
```
(string-ci string1 string2)
-Function return true if second string is larger then the first one.
+Returns true if the second string is larger than the first one, ignoring case.
```
## string-ci>=?
```
(string-ci>=? string1 string2)
-Function return true if second character is not smaller then the first one.
+Returns true if second character is not smaller than the first one, ignoring case.
```
## string-copy
```
(string-copy x)
-Create new string based of given argument.
+Creates a new string based on given argument.
```
## string-fill!
```
(string-fill! symbol char)
-Function destructively fill the string with given character.
+Function that destructively fills the string with given character.
```
## string-join
```
(join separator list)
-Function return string by joining elements of the list
+Function that returns a string by joining elements of the list using separator.
```
## string-length
```
(string-length string)
-Function return length of the string.
+Returns the length of the string.
```
## string-map
```
(string-map fn string1 stringr2 ...)
-Function return new string from applying function fn to each element
+Returns new string from applying function fn to each element
of the strings, similar to map for lists.
```
@@ -3140,14 +3242,14 @@ of the strings, similar to map for lists.
```
(string-ref string k)
-Function return character inside string at given zero-based index.
+Returns character inside string at given zero-based index.
```
## string-split
```
(split separator string)
-Function create list by splitting string by separatar that can
+Function that creates a list by splitting string by separator which can
be a string or regular expression.
```
@@ -3155,117 +3257,140 @@ be a string or regular expression.
```
(string? expression)
-Function check if value is a string.
+Predicate that tests if value is a string.
```
## string
```
(string string1 string2)
-Function return true if second string is smaller then the first one.
+Returns true if the second string is smaller than the first one.
```
## string<=?
```
(string string1 string2)
-Function return true if second string is not larger then the first one.
+Returns true if the second string is not larger than the first one.
```
## string=?
```
(string=? string1 string2)
-Function check if two string s are equal.
+Checks if two strings are equal.
```
## string>?
```
(string string1 string2)
-Function return true if second string is larger then the first one.
+Returns true if the second string is larger than the first one.
```
## string>=?
```
(string string1 string2)
-Function return true if second character is not smaller then the first one.
+Returns true if second character is not smaller then the first one.
```
## substring
```
(substring string start end)
-Function return part of the string starting at start ending with end.
+Function that returns the slice of the string starting at start and ending
+with end.
+```
+
+## sxml-unquote
+```
+(sxml-unquote expression) or ~expression
+
+Treat expression as code and evaluate it inside sxml, similar to unquote
+with quasiquote.
+```
+
+## sxml-unquote-mapper
+```
+#
```
## symbol->string
```
(symbol->string symbol)
-Function convert LIPS symbol to string.
+Function that converts a LIPS symbol to a string.
+```
+
+## symbol-append
+```
+(symbol-append s1 s2 ...)
+
+Function that creates a new symbol from symbols passed as arguments.
```
## symbol?
```
(symbol? expression)
-Function check if value is LIPS symbol
+Predicate that tests if value is a LIPS symbol.
```
## symbol=?
```
(symbol=? s1 s2 ...)
-Function check if each value is symbol and it's the same acording to string=? predicate.
+Checks if each value is symbol and it's the same according to string=? predicate.
```
## take
```
(take n list)
-Return n first values of the list.
+Returns n first values of the list.
```
## tan
```
-#
+(tan n)
+
+Function that calculates tangent of a number.
```
## textual-port?
```
(textual-port? port)
-Function test if argument is string port.
+Function that tests if argument is string port.
```
## throw
```
(throw string)
-Throws new expection.
+Throws a new exception.
```
## tree->array
```
(tree->array list)
-Function convert LIPS list structure into JavaScript array.
+Function that converts a LIPS cons tree structure into a JavaScript array.
```
## tree-map
```
(tree-map fn tree)
-Tree version of map. Function is invoked on every leaf.
+Tree version of map. fn is invoked on every leaf.
```
## truncate
```
(truncate n)
-Function return integer value from real number.
+Function that returns the integer part (floor) of a real number.
```
## truncate-quotient
@@ -3287,37 +3412,37 @@ Function return integer value from real number.
```
(type object)
-Function return type of an object as string.
+Function that returns the type of an object as string.
```
## typecheck
```
(typecheck label value type [position])
-Function check type and throw exception if type don't match.
-Type can be string or list of strings. Position optional argument
-is used to created proper error message.
+Checks the type of value and errors if the type is not one allowed. Type can be
+string or list of strings. The position optional argument is used to create a
+proper error message for the nth argument of function calls.
```
## typecheck-args
```
(typecheck-args args type)
-Function check if all items in array are of same type.
+Function that makes sure that all items in the array are of same type.
```
## typed-array?
```
(typed-array? o)
-Function test if argumnet is JavaScript typed array (Scheme byte vector).
+Function that tests if the arguments is a JavaScript typed array (Scheme byte vector).
```
## u16vector
```
(u16vector v1 v2 ...)
-Create usigned 16-bit integer vector from give arguments.
+Create unsigned 16-bit integer vector (C unsigned short) from give arguments.
```
## u16vector->list
@@ -3329,35 +3454,35 @@ Create usigned 16-bit integer vector from give arguments.
```
(u16vector-length v)
-return length of usigned 16-bit integer vector.
+return length of unsigned 16-bit integer vector (C unsigned short).
```
## u16vector-ref
```
(u16vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## u16vector-set!
```
(u16vector-set! vector k)
-Function set value of usigned 16-bit integer vector at index k. If index is out of range it throw exception.
+Function set value of unsigned 16-bit integer vector (C unsigned short) at index k. If index is out of range it throw exception.
```
## u16vector?
```
(u16vector? x)
-Function return #t of argument is usigned 16-bit integer vector otherwise it return #f.
+Returns #t of argument is unsigned 16-bit integer vector (C unsigned short) otherwise it return #f.
```
## u32vector
```
(u32vector v1 v2 ...)
-Create usigned 32-bit integer vector from give arguments.
+Create unsigned 32-bit integer vector (C int) from give arguments.
```
## u32vector->list
@@ -3369,28 +3494,28 @@ Create usigned 32-bit integer vector from give arguments.
```
(u32vector-length v)
-return length of usigned 32-bit integer vector.
+return length of unsigned 32-bit integer vector (C int).
```
## u32vector-ref
```
(u32vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## u32vector-set!
```
(u32vector-set! vector k)
-Function set value of usigned 32-bit integer vector at index k. If index is out of range it throw exception.
+Function set value of unsigned 32-bit integer vector (C int) at index k. If index is out of range it throw exception.
```
## u32vector?
```
(u32vector? x)
-Function return #t of argument is usigned 32-bit integer vector otherwise it return #f.
+Returns #t of argument is unsigned 32-bit integer vector (C int) otherwise it return #f.
```
## u8-ready?
@@ -3407,7 +3532,7 @@ guaranteed not to hang. If the port is at end of file then u8-ready? returns #t.
```
(u8vector v1 v2 ...)
-Create usigned 8-bit integer vector from give arguments.
+Create unsigned 8-bit integer vector (C unsigned char) from give arguments.
```
## u8vector->list
@@ -3419,78 +3544,76 @@ Create usigned 8-bit integer vector from give arguments.
```
(u8vector-length v)
-return length of usigned 8-bit integer vector.
+return length of unsigned 8-bit integer vector (C unsigned char).
```
## u8vector-ref
```
(u8vector-ref vector k)
-Function return value frome vector at index k. If index is out of range it throw exception.
+Returns value from vector at index k. If index is out of range it throw exception.
```
## u8vector-set!
```
(u8vector-set! vector k)
-Function set value of usigned 8-bit integer vector at index k. If index is out of range it throw exception.
+Function set value of unsigned 8-bit integer vector (C unsigned char) at index k. If index is out of range it throw exception.
```
## u8vector?
```
(u8vector? x)
-Function return #t of argument is usigned 8-bit integer vector otherwise it return #f.
+Returns #t of argument is unsigned 8-bit integer vector (C unsigned char) otherwise it return #f.
```
## unary
```
(unary fn)
-Function return new function with arguments limited to one.
+Returns a new function with arguments limited to one.
```
## unbind
```
(unbind fn)
-Function remove bidning from function so you can get props from it.
+Function that removes the weak 'this' binding from a function so you
+can get properties from the actual function object.
```
## unfold
```
(unfold fn init)
-Function returns list from given function and init value. The function should
-return cons where first is the item added to the list and second is next value
-passed to the funtion. If function return false it end the loop.
+Returns a list from the given function and init value. The function should
+return a pair where first is the item added to the list and second is next value
+passed to the function. If the function returns false it ends the loop.
```
## unquote
```
-(unquote code)
+(unquote code) or ,code
-Special form to be used in quasiquote macro, parser is processing special
-characters , and create call to this pseudo function. It can be used
-to evalute expression inside and return the value, the output is inserted
-into list structure created by queasiquote.
+Special form used in the quasiquote macro. It evaluates the expression inside and
+substitutes the value into quasiquote's result.
```
## unquote-splicing
```
-(unquote-splicing code)
+(unquote-splicing code) or ,@code
-Special form to be used in quasiquote macro, parser is processing special
-characters ,@ and create call to this pseudo function. It can be used
-to evalute expression inside and return the value without parenthesis.
-the value will be joined to the output list structure.
+Special form used in the quasiquote macro. It evaluates the expression inside and
+splices the list into quasiquote's result. If it is not the last element of the
+expression, the computed value must be a pair.
```
## unset-repr!
```
(unset-repr! type)
-Function remove string represention to the type, which should be constructor function,
+Removes the string representation of the type, which should be constructor function,
added by add-repr! function.
```
@@ -3498,7 +3621,7 @@ added by add-repr! function.
```
(unset-special! name)
-Function remove special symbol from parser. Added by `set-special!`,
+Function that removes a special symbol from parser added by `set-special!`,
name must be a string.
```
@@ -3508,7 +3631,7 @@ name must be a string.
(utf8->string u8vector start)
(utf8->string u8vector start end)
-Function converts u8 bytevector into string using utf8 encoding.
+Converts u8 bytevector into string using utf8 encoding.
The start and end is the range of the input byte vector for the conversion.
```
@@ -3516,22 +3639,22 @@ The start and end is the range of the input byte vector for the conversion.
```
(value obj)
-Function unwrap LNumbers and convert nil value to undefined.
+Function that unwraps LNumbers and converts nil to undefined.
```
## values
```
(values a1 a2 ...)
-If called with more then one elment it will create special
-Values object that can be used in call-with-values function
+If called with more then one element it will create a special
+Values object that can be used in the call-with-values function.
```
## values-ref
```
(values-ref values n)
-Function return n value of values object which is result of value function.
+Returns n value of values object which is result of value function.
```
## vector->f32vector
@@ -3550,7 +3673,7 @@ Function return n value of values object which is result of value function.
(vector->list vector start)
(vector->list vector start end)
-Function copy given range of vector to list. If no start is specified it use
+Function that copies given range of vector to list. If no start is specified it use
start of the vector, if no end is specified it convert to the end of the vector.
```
@@ -3575,7 +3698,7 @@ start of the vector, if no end is specified it convert to the end of the vector.
(vector->string vector start)
(vector->string vector start end)
-Function return new string created from vector of characters in given range.
+Returns new string created from vector of characters in given range.
If no start is given it create string from 0, if no end is given it return
string to the end.
```
@@ -3599,7 +3722,7 @@ string to the end.
```
(vector-append v1 v2 ...)
-Function return new vector by combining it's arguments that should be vectors.
+Returns new vector by combining it's arguments that should be vectors.
```
## vector-fill!
@@ -3616,14 +3739,14 @@ at 0. If end is not given it fill till the end if the vector.
```
(vector-length vec)
-Function return length of the vector. If argument is not vector it throw exception.
+Returns length of the vector. It errors if the argument is not a vector.
```
## vector-map
```
(vector-map fn vector1 vector2 ...)
-Function return new vector from applying function fn to each element
+Returns new vector from applying function fn to each element
of the vectors, similar to map for lists.
```
@@ -3631,21 +3754,21 @@ of the vectors, similar to map for lists.
```
(vector-ref vec n)
-Function return nth element of the vector vec.
+Returns nth element of the vector vec.
```
## vector-set!
```
(vector-set! vec n value)
-Function set nth item of the vector to value.
+Function that sets nth item of the vector to value.
```
## vector?
```
(vector? n)
-Function return true of value is vector and false if not.
+Returns true if value is vector and false if not.
```
## with-exception-handler
@@ -3665,6 +3788,24 @@ After thunk is executed current-input-port is restored and file port
is closed.
```
+## with-input-from-port
+```
+(with-input-from-port port thunk)
+
+Procedure use port and make it current-input-port then thunk is executed.
+After thunk is executed current-input-port is restored and given port
+is closed.
+```
+
+## with-input-from-string
+```
+(with-input-from-string string thunk)
+
+Procedure open string and make it current-input-port then thunk is executed.
+After thunk is executed current-input-port is restored and string port
+is closed.
+```
+
## with-output-to-file
```
#
@@ -3732,6 +3873,6 @@ Write byte into binary output port.
```
(zero? x)
-Function check if number is equal to 0
+Checks if the number is equal to 0
```
diff --git a/assets/Interpreter.dia b/assets/Interpreter.dia
index dc50b39e4..8800b017d 100644
Binary files a/assets/Interpreter.dia and b/assets/Interpreter.dia differ
diff --git a/assets/Interpreter.svg b/assets/Interpreter.svg
index caacd2045..991f21a71 100644
--- a/assets/Interpreter.svg
+++ b/assets/Interpreter.svg
@@ -1,144 +1,153 @@
-
+
-
-
-
- Parser
+
+
+
+ Parser
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
- Lexer
+
+
+
+ Lexer
-
-
-
- Character Stream
+
+
+
+ Character Stream
-
-
-
- exec
+
+
+
+ exec
-
-
-
- evaluate
+
+
+
+ evaluate
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
- Syntax
- Extension
+
+ Syntax
+ Extension
-
-
-
+
+
+
-
-
-
-
-
-
-
-
- Environment
+
+
+
+ Environment
-
-
-
+
+
+
-
-
-
+
+
+
-
- apply
+
+ apply
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
+
+ ES6 Generator
+
+
+
+
+
+ State Machine
+
diff --git a/assets/classDiagram b/assets/classDiagram
index c27bfc22f..7ba779d56 100644
--- a/assets/classDiagram
+++ b/assets/classDiagram
@@ -235,7 +235,7 @@ class Lexer {
class Parser {
Lexer __lexer__
- Environent __env__
+ Environment __env__
resolve()
peek()
skip()
diff --git a/assets/classDiagram.svg b/assets/classDiagram.svg
index 472ccbab1..1932ca675 100644
--- a/assets/classDiagram.svg
+++ b/assets/classDiagram.svg
@@ -1 +1 @@
-LNumber Number __value__ isFloat() isNumber() isComplex() isRational() isNative() isBigInteger() isBN() getType() coerce() op() sqrt() pow() abs() isOdd() isEven() cmp() LBigInteger BigInt __value__ sqrt() gcd() sqrt() LRational LNumber __num__ LNumber __denom__ pow() abs() cmp() mul() div() sub() add() valueOf() toString() LFloat Number __value__ toRational() toString() LComplex LNumber __im__ LNumber __re__ sqrt() toRational() add() factor() modulus() sqrt() div() sub() mul() cmp() toString() InputPort Parser __parser__ read_char() skip_char() read_line() read() char_ready() is_open() close() toString() InputStringPort symbol __type__ char_ready() toString() InputFilePort string __filename__ toStgring() OutputPort symbol __type__ write() is_open() close() toString() OutputStringPort string[] __buffer__ symbol __type__ write() valueOf() toString() OutputFilePort string __filename__ symbol __type__ fs() internal() close() toString() OutputByteVectorPort Uin8Array __buffer__ symbol __type__ write(any) close() write_u8(byte) write_u8_vector(Uint8Array) toString() valueOf() InputByteVectorPort symbol __type__ Uint8Array __vector__ integer __index__ string __filename__ toString() u8_ready() peek_u8() skip() read_u8() read_u8_vector(integer) toString() InputBinaryFilePort string __filename__ toString() OutputBinaryFilePort string __filename__ symbol __type__ write(any) write_u8(byte) write_u8_vector(Uint8Array) Parser Lexer __lexer__ Environent __env__ resolve() peek() skip() read() is_special(token) is_builtin(token) is_open(token) is_close(token) read_list() read_value() read_object() is_ccomment(token) evaluate(code) Lexer string __input__ static rules token(meta) peek(meta) skip() read_line() read_rest() read_string(num) peek_char() read_char() skip_char() match_rule() next_token() Macro string __doc__ string __name__ boolean __defmacro__ Function __fn__ defmacro() invoke() toString() Syntax invoke() toString() String LString string __string__ number length toString() get(number) cmp(string) lower() upper() set(number, LCharacter) clone() fill(LCharacter) Formatter string __code__ indent(object) exception_shift(token, object) break() format() Ahead Pattern rule pattern string flag Interpreter Environment __env__ get(symbol) set(symbol, value) constant(name, value) exec(code, dynamic = false, env = null) Environment string __name__ Map __docs__ Object __env__ Environment __parent__ list() uset(name) inherit(name, object) doc(name, value = null) get(symbol, options) set(symbol, value, doc = null) constant(name, value) has(string) ref(string) parents() newFrame(Function, args) clone() merge() toString() Worker string url Worker worker rpc(method, params) exec(code, [dynamic]) LCharacter string __name__ string __char__ toUpperCase() toLowerCase() toString() valueOf() LSymbol string __name__ Values any[] __values__ valueOf() toString() QuotedPromise Promise __promise__ then() catch() valueOf() Pair any car any cdr flatten() length() find(any) clone() last_pair() to_array() to_object() reduce(Function) reverse() transform(Function) map(Function)
\ No newline at end of file
+
LNumber
Number __value__
isFloat()
isNumber()
isComplex()
isRational()
isNative()
isBigInteger()
isBN()
getType()
coerce()
op()
sqrt()
pow()
abs()
isOdd()
isEven()
cmp()
LBigInteger
BigInt __value__
sqrt()
gcd()
sqrt()
LRational
LNumber __num__
LNumber __denom__
pow()
abs()
cmp()
mul()
div()
sub()
add()
valueOf()
toString()
LFloat
Number __value__
toRational()
toString()
LComplex
LNumber __im__
LNumber __re__
sqrt()
toRational()
add()
factor()
modulus()
sqrt()
div()
sub()
mul()
cmp()
toString()
InputPort
Parser __parser__
read_char()
skip_char()
read_line()
read()
char_ready()
is_open()
close()
toString()
InputStringPort
symbol __type__
char_ready()
toString()
InputFilePort
string __filename__
toStgring()
OutputPort
symbol __type__
write()
is_open()
close()
toString()
OutputStringPort
string[] __buffer__
symbol __type__
write()
valueOf()
toString()
OutputFilePort
string __filename__
symbol __type__
fs()
internal()
close()
toString()
OutputByteVectorPort
Uin8Array __buffer__
symbol __type__
write(any)
close()
write_u8(byte)
write_u8_vector(Uint8Array)
toString()
valueOf()
InputByteVectorPort
symbol __type__
Uint8Array __vector__
integer __index__
string __filename__
toString()
u8_ready()
peek_u8()
skip()
read_u8()
read_u8_vector(integer)
toString()
InputBinaryFilePort
string __filename__
toString()
OutputBinaryFilePort
string __filename__
symbol __type__
write(any)
write_u8(byte)
write_u8_vector(Uint8Array)
Parser
Lexer __lexer__
Environment __env__
resolve()
peek()
skip()
read()
is_special(token)
is_builtin(token)
is_open(token)
is_close(token)
read_list()
read_value()
read_object()
is_ccomment(token)
evaluate(code)
Lexer
string __input__
static rules
token(meta)
peek(meta)
skip()
read_line()
read_rest()
read_string(num)
peek_char()
read_char()
skip_char()
match_rule()
next_token()
Macro
string __doc__
string __name__
boolean __defmacro__
Function __fn__
defmacro()
invoke()
toString()
Syntax
invoke()
toString()
String
LString
string __string__
number length
toString() : string
get(number) : string
cmp(string) : boolean
lower() : LString
upper() : LString
set(number, LCharacter)
clone() : LString
fill(LCharacter)
Formatter
string __code__
indent(object) : number
exception_shift(token, object) : number
break() : Formatter
format() : string
Ahead
Pattern
rule pattern
string flag
Interpreter
Environment __env__
get(symbol)
set(symbol, value)
constant(name, value)
exec(code, dynamic = false, env = null)
Environment
string __name__
Map __docs__
Object __env__
Environment __parent__
list() : string[]
uset(name)
inherit(name, object) : Environment
doc(name, value = null)
get(symbol, options)
set(symbol, value, doc = null)
constant(name, value)
has(string) : boolean
ref(string) : Environment
parents() : Environment[]
newFrame(Function, args)
clone() : Environment
merge() : Environment
toString() : string
Worker
string url
Worker worker
rpc(method, params) : Promise
exec(code, [dynamic]) : Promise
LCharacter
string __name__
string __char__
toUpperCase() : LCharacter
toLowerCase() : LCharacter
toString() : string
valueOf() : string
LSymbol
string __name__
Values
any[] __values__
valueOf()
toString()
QuotedPromise
Promise __promise__
then()
catch()
valueOf()
Pair
any car
any cdr
flatten()
length()
find(any)
clone()
last_pair()
to_array()
to_object()
reduce(Function)
reverse() : Pair
transform(Function)
map(Function)
\ No newline at end of file
diff --git a/benchmarks/helpers.scm b/benchmarks/helpers.scm
index 73624acfc..97a8868a4 100644
--- a/benchmarks/helpers.scm
+++ b/benchmarks/helpers.scm
@@ -7,7 +7,8 @@
(run &(:async true))
(on "cycle" (lambda (e)
- (print (string-append ">>> " (String target)))))
+ (console.log e.target)
+ (print (string-append ">>> " (e.target.toString)))))
(on "complete" (lambda (e)
(try
@@ -16,4 +17,4 @@
(map "name")
0))))
(catch (e)
- (print e))))))))
\ No newline at end of file
+ (print e))))))))
diff --git a/bin/lips.js b/bin/lips.js
index 1cde54262..75fe4f6cf 100755
--- a/bin/lips.js
+++ b/bin/lips.js
@@ -42,6 +42,7 @@ import readline from 'readline';
import highlight from 'prism-cli';
import Prism from 'prismjs';
import 'prismjs/components/prism-scheme.min.js';
+import { satisfies } from 'compare-versions';
import '../lib/js/prism.js';
import { createRequire } from 'module';
@@ -50,6 +51,8 @@ const require = createRequire(import.meta.url);
const kDebounceHistoryMS = 15;
+const supports_paste_brackets = satisfies(process.version, '>=v20.6.0');
+
// -----------------------------------------------------------------------------
process.on('uncaughtException', function (err) {
log_error(err.message);
@@ -200,14 +203,15 @@ const moduleURL = new URL(import.meta.url);
const __dirname = path.dirname(moduleURL.pathname);
const __filename = path.basename(moduleURL.pathname);
const command_line = [];
-var interp = Interpreter('repl', {
+let last_line = '';
+const interp = Interpreter('repl', {
stdin: InputPort(function() {
return new Promise(function(resolve) {
rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
- rl.question('', function(data) {
+ rl.question(last_line, function(data) {
resolve(data);
rl.close();
});
@@ -219,6 +223,7 @@ var interp = Interpreter('repl', {
x = this.get('repr')(x);
}
newline = !x.match(/\n$/);
+ last_line = x.split('\n').pop();
process.stdout.write(x);
}),
// -------------------------------------------------------------------------
@@ -427,9 +432,9 @@ function unify_prompt(a, b) {
function run_repl(err, rl) {
const dynamic = options.d || options.dynamic;
- var code = '';
- var multiline = false;
- var resolve;
+ let cmd = '';
+ let multiline = false;
+ let resolve;
// we use promise loop to fix issue when copy paste list of S-Expression
let prev_eval = Promise.resolve();
if (process.stdin.isTTY) {
@@ -437,25 +442,25 @@ function run_repl(err, rl) {
}
let prev_line;
bootstrap(interp).then(function() {
+ if (supports_paste_brackets) {
+ process.stdin.on('keypress', (c, k) => {
+ if (k?.name?.match(/^paste-/)) {
+ cmd += k.sequence;
+ }
+ });
+ process.stdout.write('\x1b[?2004h');
+ }
+ const re = /\x1b\[(200|201)~/g;
rl.on('line', function(line) {
- code += line;
+ cmd += line;
+ if (cmd.match(/\x1b\[201~$/)) {
+ cmd = cmd.replace(re, '');
+ }
+ const code = cmd.replace(re, '');
const lines = code.split('\n');
- const cols = process.stdout.columns;
- // fix formatting for previous lines that was echo
- // ReadLine will not handle those
if (terminal && lines.length > 2) {
- var count = 0;
- // correction when line wrapps in original line
- // that will be overwritten
- lines.map(line => {
- if (line.length > cols) {
- count += Math.ceil(line.length / cols) - 1;
- }
- });
- var f = new Formatter(code);
- code = f.format();
const stdout = scheme(code).split('\n').map((line, i) => {
- var prefix;
+ let prefix;
if (i === 0) {
prefix = unify_prompt(prompt, continuePrompt);
} else {
@@ -463,11 +468,11 @@ function run_repl(err, rl) {
}
return '\x1b[K' + prefix + line;
}).join('\n');
- let num = lines.length + count + 1;
+ let num = lines.length;
const format = `\x1b[${num}F${stdout}\n`;
process.stdout.write(format);
}
- code += '\n';
+ cmd += '\n';
try {
if (balanced_parenthesis(code)) {
// we need to clear the prompt because resume
@@ -477,7 +482,7 @@ function run_repl(err, rl) {
rl.pause();
prev_eval = prev_eval.then(function() {
const result = run(code, interp, dynamic, null, options.t || options.trace);
- code = '';
+ cmd = '';
return result;
}).then(function(result) {
if (process.stdin.isTTY) {
@@ -507,18 +512,26 @@ function run_repl(err, rl) {
});
} else {
multiline = true;
- const ind = indent(code, 2, prompt.length - continuePrompt.length);
- rl.setPrompt(continuePrompt);
- rl.prompt();
- const spaces = new Array(ind + 1).join(' ');
- if (terminal) {
- rl.write(spaces);
+ if (cmd.match(/\x1b\[200~/) || !supports_paste_brackets) {
+ rl.setPrompt(continuePrompt);
+ rl.prompt();
+ if (terminal) {
+ rl.write(' '.repeat(prompt.length - continuePrompt.length));
+ }
+ } else {
+ const ind = indent(code, 2, prompt.length - continuePrompt.length);
+ const spaces = new Array(ind + 1).join(' ');
+ rl.setPrompt(continuePrompt);
+ rl.prompt();
+ if (terminal) {
+ rl.write(spaces);
+ }
}
}
} catch (e) {
console.error(e.message);
console.error(e.stack);
- code = '';
+ cmd = '';
rl.setPrompt(prompt);
rl.prompt();
}
diff --git a/dist/lips.js b/dist/lips.js
index d07dfe155..b71748e5f 100644
--- a/dist/lips.js
+++ b/dist/lips.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. 1.0.0-beta.16
+ * \_\ /_/ \_\ /_/ v. DEV
*
* LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript
*
@@ -31,7 +31,7 @@
* Copyright (c) 2014-present, Facebook, Inc.
* released under MIT license
*
- * build: Mon, 15 Nov 2021 19:33:52 +0000
+ * build: Wed, 22 Nov 2023 13:53:23 +0000
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -98,23 +98,20 @@
configurable: true
}
});
+ Object.defineProperty(subClass, "prototype", {
+ writable: false
+ });
if (superClass) _setPrototypeOf(subClass, superClass);
}
function _typeof(obj) {
"@babel/helpers - typeof";
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
- _typeof = function _typeof(obj) {
- return typeof obj;
- };
- } else {
- _typeof = function _typeof(obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- }
-
- return _typeof(obj);
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
}
function _possibleConstructorReturn(self, call) {
@@ -236,6 +233,9 @@
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
+ Object.defineProperty(Constructor, "prototype", {
+ writable: false
+ });
return Constructor;
}
@@ -322,20 +322,6 @@
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
}
- function _asyncIterator(iterable) {
- var method;
-
- if (typeof Symbol !== "undefined") {
- if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];
- if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];
- }
-
- if (method == null) method = iterable["@@asyncIterator"];
- if (method == null) method = iterable["@@iterator"];
- if (method == null) throw new TypeError("Object is not async iterable");
- return method.call(iterable);
- }
-
function _AwaitValue(value) {
this.wrapped = value;
}
@@ -445,6 +431,12 @@
};
}
+ function getDefaultExportFromCjs (x) {
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
+ }
+
+ var regenerator = {exports: {}};
+
var runtime = {exports: {}};
/**
@@ -455,755 +447,759 @@
*/
(function (module) {
- var runtime = (function (exports) {
-
- var Op = Object.prototype;
- var hasOwn = Op.hasOwnProperty;
- var undefined$1; // More compressible than void 0.
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
-
- function define(obj, key, value) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- return obj[key];
- }
- try {
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
- define({}, "");
- } catch (err) {
- define = function(obj, key, value) {
- return obj[key] = value;
- };
- }
-
- function wrap(innerFn, outerFn, self, tryLocsList) {
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
- var generator = Object.create(protoGenerator.prototype);
- var context = new Context(tryLocsList || []);
-
- // The ._invoke method unifies the implementations of the .next,
- // .throw, and .return methods.
- generator._invoke = makeInvokeMethod(innerFn, self, context);
-
- return generator;
- }
- exports.wrap = wrap;
-
- // Try/catch helper to minimize deoptimizations. Returns a completion
- // record like context.tryEntries[i].completion. This interface could
- // have been (and was previously) designed to take a closure to be
- // invoked without arguments, but in all the cases we care about we
- // already have an existing method we want to call, so there's no need
- // to create a new function object. We can even get away with assuming
- // the method takes exactly one argument, since that happens to be true
- // in every case, so we don't have to touch the arguments object. The
- // only additional allocation required is the completion record, which
- // has a stable shape and so hopefully should be cheap to allocate.
- function tryCatch(fn, obj, arg) {
- try {
- return { type: "normal", arg: fn.call(obj, arg) };
- } catch (err) {
- return { type: "throw", arg: err };
- }
- }
-
- var GenStateSuspendedStart = "suspendedStart";
- var GenStateSuspendedYield = "suspendedYield";
- var GenStateExecuting = "executing";
- var GenStateCompleted = "completed";
-
- // Returning this object from the innerFn has the same effect as
- // breaking out of the dispatch switch statement.
- var ContinueSentinel = {};
-
- // Dummy constructor functions that we use as the .constructor and
- // .constructor.prototype properties for functions that return Generator
- // objects. For full spec compliance, you may wish to configure your
- // minifier not to mangle the names of these two functions.
- function Generator() {}
- function GeneratorFunction() {}
- function GeneratorFunctionPrototype() {}
-
- // This is a polyfill for %IteratorPrototype% for environments that
- // don't natively support it.
- var IteratorPrototype = {};
- define(IteratorPrototype, iteratorSymbol, function () {
- return this;
- });
-
- var getProto = Object.getPrototypeOf;
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
- if (NativeIteratorPrototype &&
- NativeIteratorPrototype !== Op &&
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
- // This environment has a native %IteratorPrototype%; use it instead
- // of the polyfill.
- IteratorPrototype = NativeIteratorPrototype;
- }
-
- var Gp = GeneratorFunctionPrototype.prototype =
- Generator.prototype = Object.create(IteratorPrototype);
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
- define(Gp, "constructor", GeneratorFunctionPrototype);
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
- GeneratorFunction.displayName = define(
- GeneratorFunctionPrototype,
- toStringTagSymbol,
- "GeneratorFunction"
- );
-
- // Helper for defining the .next, .throw, and .return methods of the
- // Iterator interface in terms of a single ._invoke method.
- function defineIteratorMethods(prototype) {
- ["next", "throw", "return"].forEach(function(method) {
- define(prototype, method, function(arg) {
- return this._invoke(method, arg);
- });
- });
- }
-
- exports.isGeneratorFunction = function(genFun) {
- var ctor = typeof genFun === "function" && genFun.constructor;
- return ctor
- ? ctor === GeneratorFunction ||
- // For the native GeneratorFunction constructor, the best we can
- // do is to check its .name property.
- (ctor.displayName || ctor.name) === "GeneratorFunction"
- : false;
- };
-
- exports.mark = function(genFun) {
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
- } else {
- genFun.__proto__ = GeneratorFunctionPrototype;
- define(genFun, toStringTagSymbol, "GeneratorFunction");
- }
- genFun.prototype = Object.create(Gp);
- return genFun;
- };
-
- // Within the body of any async function, `await x` is transformed to
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
- // meant to be awaited.
- exports.awrap = function(arg) {
- return { __await: arg };
- };
-
- function AsyncIterator(generator, PromiseImpl) {
- function invoke(method, arg, resolve, reject) {
- var record = tryCatch(generator[method], generator, arg);
- if (record.type === "throw") {
- reject(record.arg);
- } else {
- var result = record.arg;
- var value = result.value;
- if (value &&
- typeof value === "object" &&
- hasOwn.call(value, "__await")) {
- return PromiseImpl.resolve(value.__await).then(function(value) {
- invoke("next", value, resolve, reject);
- }, function(err) {
- invoke("throw", err, resolve, reject);
- });
- }
-
- return PromiseImpl.resolve(value).then(function(unwrapped) {
- // When a yielded Promise is resolved, its final value becomes
- // the .value of the Promise<{value,done}> result for the
- // current iteration.
- result.value = unwrapped;
- resolve(result);
- }, function(error) {
- // If a rejected Promise was yielded, throw the rejection back
- // into the async generator function so it can be handled there.
- return invoke("throw", error, resolve, reject);
- });
- }
- }
-
- var previousPromise;
-
- function enqueue(method, arg) {
- function callInvokeWithMethodAndArg() {
- return new PromiseImpl(function(resolve, reject) {
- invoke(method, arg, resolve, reject);
- });
- }
-
- return previousPromise =
- // If enqueue has been called before, then we want to wait until
- // all previous Promises have been resolved before calling invoke,
- // so that results are always delivered in the correct order. If
- // enqueue has not been called before, then it is important to
- // call invoke immediately, without waiting on a callback to fire,
- // so that the async generator function has the opportunity to do
- // any necessary setup in a predictable way. This predictability
- // is why the Promise constructor synchronously invokes its
- // executor callback, and why async functions synchronously
- // execute code before the first await. Since we implement simple
- // async functions in terms of async generators, it is especially
- // important to get this right, even though it requires care.
- previousPromise ? previousPromise.then(
- callInvokeWithMethodAndArg,
- // Avoid propagating failures to Promises returned by later
- // invocations of the iterator.
- callInvokeWithMethodAndArg
- ) : callInvokeWithMethodAndArg();
- }
-
- // Define the unified helper method that is used to implement .next,
- // .throw, and .return (see defineIteratorMethods).
- this._invoke = enqueue;
- }
-
- defineIteratorMethods(AsyncIterator.prototype);
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
- return this;
- });
- exports.AsyncIterator = AsyncIterator;
-
- // Note that simple async functions are implemented on top of
- // AsyncIterator objects; they just return a Promise for the value of
- // the final result produced by the iterator.
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
- if (PromiseImpl === void 0) PromiseImpl = Promise;
-
- var iter = new AsyncIterator(
- wrap(innerFn, outerFn, self, tryLocsList),
- PromiseImpl
- );
-
- return exports.isGeneratorFunction(outerFn)
- ? iter // If outerFn is a generator, return the full iterator.
- : iter.next().then(function(result) {
- return result.done ? result.value : iter.next();
- });
- };
-
- function makeInvokeMethod(innerFn, self, context) {
- var state = GenStateSuspendedStart;
-
- return function invoke(method, arg) {
- if (state === GenStateExecuting) {
- throw new Error("Generator is already running");
- }
-
- if (state === GenStateCompleted) {
- if (method === "throw") {
- throw arg;
- }
-
- // Be forgiving, per 25.3.3.3.3 of the spec:
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
- return doneResult();
- }
-
- context.method = method;
- context.arg = arg;
-
- while (true) {
- var delegate = context.delegate;
- if (delegate) {
- var delegateResult = maybeInvokeDelegate(delegate, context);
- if (delegateResult) {
- if (delegateResult === ContinueSentinel) continue;
- return delegateResult;
- }
- }
-
- if (context.method === "next") {
- // Setting context._sent for legacy support of Babel's
- // function.sent implementation.
- context.sent = context._sent = context.arg;
-
- } else if (context.method === "throw") {
- if (state === GenStateSuspendedStart) {
- state = GenStateCompleted;
- throw context.arg;
- }
-
- context.dispatchException(context.arg);
-
- } else if (context.method === "return") {
- context.abrupt("return", context.arg);
- }
-
- state = GenStateExecuting;
-
- var record = tryCatch(innerFn, self, context);
- if (record.type === "normal") {
- // If an exception is thrown from innerFn, we leave state ===
- // GenStateExecuting and loop back for another invocation.
- state = context.done
- ? GenStateCompleted
- : GenStateSuspendedYield;
-
- if (record.arg === ContinueSentinel) {
- continue;
- }
-
- return {
- value: record.arg,
- done: context.done
- };
-
- } else if (record.type === "throw") {
- state = GenStateCompleted;
- // Dispatch the exception by looping back around to the
- // context.dispatchException(context.arg) call above.
- context.method = "throw";
- context.arg = record.arg;
- }
- }
- };
- }
-
- // Call delegate.iterator[context.method](context.arg) and handle the
- // result, either by returning a { value, done } result from the
- // delegate iterator, or by modifying context.method and context.arg,
- // setting context.delegate to null, and returning the ContinueSentinel.
- function maybeInvokeDelegate(delegate, context) {
- var method = delegate.iterator[context.method];
- if (method === undefined$1) {
- // A .throw or .return when the delegate iterator has no .throw
- // method always terminates the yield* loop.
- context.delegate = null;
-
- if (context.method === "throw") {
- // Note: ["return"] must be used for ES3 parsing compatibility.
- if (delegate.iterator["return"]) {
- // If the delegate iterator has a return method, give it a
- // chance to clean up.
- context.method = "return";
- context.arg = undefined$1;
- maybeInvokeDelegate(delegate, context);
-
- if (context.method === "throw") {
- // If maybeInvokeDelegate(context) changed context.method from
- // "return" to "throw", let that override the TypeError below.
- return ContinueSentinel;
- }
- }
-
- context.method = "throw";
- context.arg = new TypeError(
- "The iterator does not provide a 'throw' method");
- }
-
- return ContinueSentinel;
- }
-
- var record = tryCatch(method, delegate.iterator, context.arg);
-
- if (record.type === "throw") {
- context.method = "throw";
- context.arg = record.arg;
- context.delegate = null;
- return ContinueSentinel;
- }
-
- var info = record.arg;
-
- if (! info) {
- context.method = "throw";
- context.arg = new TypeError("iterator result is not an object");
- context.delegate = null;
- return ContinueSentinel;
- }
-
- if (info.done) {
- // Assign the result of the finished delegate to the temporary
- // variable specified by delegate.resultName (see delegateYield).
- context[delegate.resultName] = info.value;
-
- // Resume execution at the desired location (see delegateYield).
- context.next = delegate.nextLoc;
-
- // If context.method was "throw" but the delegate handled the
- // exception, let the outer generator proceed normally. If
- // context.method was "next", forget context.arg since it has been
- // "consumed" by the delegate iterator. If context.method was
- // "return", allow the original .return call to continue in the
- // outer generator.
- if (context.method !== "return") {
- context.method = "next";
- context.arg = undefined$1;
- }
-
- } else {
- // Re-yield the result returned by the delegate method.
- return info;
- }
-
- // The delegate iterator is finished, so forget it and continue with
- // the outer generator.
- context.delegate = null;
- return ContinueSentinel;
- }
-
- // Define Generator.prototype.{next,throw,return} in terms of the
- // unified ._invoke helper method.
- defineIteratorMethods(Gp);
-
- define(Gp, toStringTagSymbol, "Generator");
-
- // A Generator should always return itself as the iterator object when the
- // @@iterator function is called on it. Some browsers' implementations of the
- // iterator prototype chain incorrectly implement this, causing the Generator
- // object to not be returned from this call. This ensures that doesn't happen.
- // See https://github.com/facebook/regenerator/issues/274 for more details.
- define(Gp, iteratorSymbol, function() {
- return this;
- });
-
- define(Gp, "toString", function() {
- return "[object Generator]";
- });
-
- function pushTryEntry(locs) {
- var entry = { tryLoc: locs[0] };
-
- if (1 in locs) {
- entry.catchLoc = locs[1];
- }
-
- if (2 in locs) {
- entry.finallyLoc = locs[2];
- entry.afterLoc = locs[3];
- }
-
- this.tryEntries.push(entry);
- }
-
- function resetTryEntry(entry) {
- var record = entry.completion || {};
- record.type = "normal";
- delete record.arg;
- entry.completion = record;
- }
-
- function Context(tryLocsList) {
- // The root entry object (effectively a try statement without a catch
- // or a finally block) gives us a place to store values thrown from
- // locations where there is no enclosing try statement.
- this.tryEntries = [{ tryLoc: "root" }];
- tryLocsList.forEach(pushTryEntry, this);
- this.reset(true);
- }
-
- exports.keys = function(object) {
- var keys = [];
- for (var key in object) {
- keys.push(key);
- }
- keys.reverse();
-
- // Rather than returning an object with a next method, we keep
- // things simple and return the next function itself.
- return function next() {
- while (keys.length) {
- var key = keys.pop();
- if (key in object) {
- next.value = key;
- next.done = false;
- return next;
- }
- }
-
- // To avoid creating an additional object, we just hang the .value
- // and .done properties off the next function object itself. This
- // also ensures that the minifier will not anonymize the function.
- next.done = true;
- return next;
- };
- };
-
- function values(iterable) {
- if (iterable) {
- var iteratorMethod = iterable[iteratorSymbol];
- if (iteratorMethod) {
- return iteratorMethod.call(iterable);
- }
-
- if (typeof iterable.next === "function") {
- return iterable;
- }
-
- if (!isNaN(iterable.length)) {
- var i = -1, next = function next() {
- while (++i < iterable.length) {
- if (hasOwn.call(iterable, i)) {
- next.value = iterable[i];
- next.done = false;
- return next;
- }
- }
-
- next.value = undefined$1;
- next.done = true;
-
- return next;
- };
-
- return next.next = next;
- }
- }
-
- // Return an iterator with no values.
- return { next: doneResult };
- }
- exports.values = values;
-
- function doneResult() {
- return { value: undefined$1, done: true };
- }
-
- Context.prototype = {
- constructor: Context,
-
- reset: function(skipTempReset) {
- this.prev = 0;
- this.next = 0;
- // Resetting context._sent for legacy support of Babel's
- // function.sent implementation.
- this.sent = this._sent = undefined$1;
- this.done = false;
- this.delegate = null;
+ var runtime = (function (exports) {
+
+ var Op = Object.prototype;
+ var hasOwn = Op.hasOwnProperty;
+ var undefined$1; // More compressible than void 0.
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
+
+ function define(obj, key, value) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ return obj[key];
+ }
+ try {
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
+ define({}, "");
+ } catch (err) {
+ define = function(obj, key, value) {
+ return obj[key] = value;
+ };
+ }
+
+ function wrap(innerFn, outerFn, self, tryLocsList) {
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
+ var generator = Object.create(protoGenerator.prototype);
+ var context = new Context(tryLocsList || []);
+
+ // The ._invoke method unifies the implementations of the .next,
+ // .throw, and .return methods.
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
+
+ return generator;
+ }
+ exports.wrap = wrap;
+
+ // Try/catch helper to minimize deoptimizations. Returns a completion
+ // record like context.tryEntries[i].completion. This interface could
+ // have been (and was previously) designed to take a closure to be
+ // invoked without arguments, but in all the cases we care about we
+ // already have an existing method we want to call, so there's no need
+ // to create a new function object. We can even get away with assuming
+ // the method takes exactly one argument, since that happens to be true
+ // in every case, so we don't have to touch the arguments object. The
+ // only additional allocation required is the completion record, which
+ // has a stable shape and so hopefully should be cheap to allocate.
+ function tryCatch(fn, obj, arg) {
+ try {
+ return { type: "normal", arg: fn.call(obj, arg) };
+ } catch (err) {
+ return { type: "throw", arg: err };
+ }
+ }
+
+ var GenStateSuspendedStart = "suspendedStart";
+ var GenStateSuspendedYield = "suspendedYield";
+ var GenStateExecuting = "executing";
+ var GenStateCompleted = "completed";
+
+ // Returning this object from the innerFn has the same effect as
+ // breaking out of the dispatch switch statement.
+ var ContinueSentinel = {};
+
+ // Dummy constructor functions that we use as the .constructor and
+ // .constructor.prototype properties for functions that return Generator
+ // objects. For full spec compliance, you may wish to configure your
+ // minifier not to mangle the names of these two functions.
+ function Generator() {}
+ function GeneratorFunction() {}
+ function GeneratorFunctionPrototype() {}
+
+ // This is a polyfill for %IteratorPrototype% for environments that
+ // don't natively support it.
+ var IteratorPrototype = {};
+ define(IteratorPrototype, iteratorSymbol, function () {
+ return this;
+ });
+
+ var getProto = Object.getPrototypeOf;
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
+ if (NativeIteratorPrototype &&
+ NativeIteratorPrototype !== Op &&
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
+ // This environment has a native %IteratorPrototype%; use it instead
+ // of the polyfill.
+ IteratorPrototype = NativeIteratorPrototype;
+ }
+
+ var Gp = GeneratorFunctionPrototype.prototype =
+ Generator.prototype = Object.create(IteratorPrototype);
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
+ define(Gp, "constructor", GeneratorFunctionPrototype);
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
+ GeneratorFunction.displayName = define(
+ GeneratorFunctionPrototype,
+ toStringTagSymbol,
+ "GeneratorFunction"
+ );
+
+ // Helper for defining the .next, .throw, and .return methods of the
+ // Iterator interface in terms of a single ._invoke method.
+ function defineIteratorMethods(prototype) {
+ ["next", "throw", "return"].forEach(function(method) {
+ define(prototype, method, function(arg) {
+ return this._invoke(method, arg);
+ });
+ });
+ }
+
+ exports.isGeneratorFunction = function(genFun) {
+ var ctor = typeof genFun === "function" && genFun.constructor;
+ return ctor
+ ? ctor === GeneratorFunction ||
+ // For the native GeneratorFunction constructor, the best we can
+ // do is to check its .name property.
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
+ : false;
+ };
+
+ exports.mark = function(genFun) {
+ if (Object.setPrototypeOf) {
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
+ } else {
+ genFun.__proto__ = GeneratorFunctionPrototype;
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
+ }
+ genFun.prototype = Object.create(Gp);
+ return genFun;
+ };
+
+ // Within the body of any async function, `await x` is transformed to
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
+ // meant to be awaited.
+ exports.awrap = function(arg) {
+ return { __await: arg };
+ };
+
+ function AsyncIterator(generator, PromiseImpl) {
+ function invoke(method, arg, resolve, reject) {
+ var record = tryCatch(generator[method], generator, arg);
+ if (record.type === "throw") {
+ reject(record.arg);
+ } else {
+ var result = record.arg;
+ var value = result.value;
+ if (value &&
+ typeof value === "object" &&
+ hasOwn.call(value, "__await")) {
+ return PromiseImpl.resolve(value.__await).then(function(value) {
+ invoke("next", value, resolve, reject);
+ }, function(err) {
+ invoke("throw", err, resolve, reject);
+ });
+ }
+
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
+ // When a yielded Promise is resolved, its final value becomes
+ // the .value of the Promise<{value,done}> result for the
+ // current iteration.
+ result.value = unwrapped;
+ resolve(result);
+ }, function(error) {
+ // If a rejected Promise was yielded, throw the rejection back
+ // into the async generator function so it can be handled there.
+ return invoke("throw", error, resolve, reject);
+ });
+ }
+ }
+
+ var previousPromise;
+
+ function enqueue(method, arg) {
+ function callInvokeWithMethodAndArg() {
+ return new PromiseImpl(function(resolve, reject) {
+ invoke(method, arg, resolve, reject);
+ });
+ }
+
+ return previousPromise =
+ // If enqueue has been called before, then we want to wait until
+ // all previous Promises have been resolved before calling invoke,
+ // so that results are always delivered in the correct order. If
+ // enqueue has not been called before, then it is important to
+ // call invoke immediately, without waiting on a callback to fire,
+ // so that the async generator function has the opportunity to do
+ // any necessary setup in a predictable way. This predictability
+ // is why the Promise constructor synchronously invokes its
+ // executor callback, and why async functions synchronously
+ // execute code before the first await. Since we implement simple
+ // async functions in terms of async generators, it is especially
+ // important to get this right, even though it requires care.
+ previousPromise ? previousPromise.then(
+ callInvokeWithMethodAndArg,
+ // Avoid propagating failures to Promises returned by later
+ // invocations of the iterator.
+ callInvokeWithMethodAndArg
+ ) : callInvokeWithMethodAndArg();
+ }
+
+ // Define the unified helper method that is used to implement .next,
+ // .throw, and .return (see defineIteratorMethods).
+ this._invoke = enqueue;
+ }
+
+ defineIteratorMethods(AsyncIterator.prototype);
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
+ return this;
+ });
+ exports.AsyncIterator = AsyncIterator;
+
+ // Note that simple async functions are implemented on top of
+ // AsyncIterator objects; they just return a Promise for the value of
+ // the final result produced by the iterator.
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
+
+ var iter = new AsyncIterator(
+ wrap(innerFn, outerFn, self, tryLocsList),
+ PromiseImpl
+ );
+
+ return exports.isGeneratorFunction(outerFn)
+ ? iter // If outerFn is a generator, return the full iterator.
+ : iter.next().then(function(result) {
+ return result.done ? result.value : iter.next();
+ });
+ };
+
+ function makeInvokeMethod(innerFn, self, context) {
+ var state = GenStateSuspendedStart;
+
+ return function invoke(method, arg) {
+ if (state === GenStateExecuting) {
+ throw new Error("Generator is already running");
+ }
+
+ if (state === GenStateCompleted) {
+ if (method === "throw") {
+ throw arg;
+ }
+
+ // Be forgiving, per 25.3.3.3.3 of the spec:
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
+ return doneResult();
+ }
+
+ context.method = method;
+ context.arg = arg;
+
+ while (true) {
+ var delegate = context.delegate;
+ if (delegate) {
+ var delegateResult = maybeInvokeDelegate(delegate, context);
+ if (delegateResult) {
+ if (delegateResult === ContinueSentinel) continue;
+ return delegateResult;
+ }
+ }
+
+ if (context.method === "next") {
+ // Setting context._sent for legacy support of Babel's
+ // function.sent implementation.
+ context.sent = context._sent = context.arg;
+
+ } else if (context.method === "throw") {
+ if (state === GenStateSuspendedStart) {
+ state = GenStateCompleted;
+ throw context.arg;
+ }
+
+ context.dispatchException(context.arg);
+
+ } else if (context.method === "return") {
+ context.abrupt("return", context.arg);
+ }
+
+ state = GenStateExecuting;
+
+ var record = tryCatch(innerFn, self, context);
+ if (record.type === "normal") {
+ // If an exception is thrown from innerFn, we leave state ===
+ // GenStateExecuting and loop back for another invocation.
+ state = context.done
+ ? GenStateCompleted
+ : GenStateSuspendedYield;
+
+ if (record.arg === ContinueSentinel) {
+ continue;
+ }
+
+ return {
+ value: record.arg,
+ done: context.done
+ };
+
+ } else if (record.type === "throw") {
+ state = GenStateCompleted;
+ // Dispatch the exception by looping back around to the
+ // context.dispatchException(context.arg) call above.
+ context.method = "throw";
+ context.arg = record.arg;
+ }
+ }
+ };
+ }
+
+ // Call delegate.iterator[context.method](context.arg) and handle the
+ // result, either by returning a { value, done } result from the
+ // delegate iterator, or by modifying context.method and context.arg,
+ // setting context.delegate to null, and returning the ContinueSentinel.
+ function maybeInvokeDelegate(delegate, context) {
+ var method = delegate.iterator[context.method];
+ if (method === undefined$1) {
+ // A .throw or .return when the delegate iterator has no .throw
+ // method always terminates the yield* loop.
+ context.delegate = null;
+
+ if (context.method === "throw") {
+ // Note: ["return"] must be used for ES3 parsing compatibility.
+ if (delegate.iterator["return"]) {
+ // If the delegate iterator has a return method, give it a
+ // chance to clean up.
+ context.method = "return";
+ context.arg = undefined$1;
+ maybeInvokeDelegate(delegate, context);
+
+ if (context.method === "throw") {
+ // If maybeInvokeDelegate(context) changed context.method from
+ // "return" to "throw", let that override the TypeError below.
+ return ContinueSentinel;
+ }
+ }
+
+ context.method = "throw";
+ context.arg = new TypeError(
+ "The iterator does not provide a 'throw' method");
+ }
+
+ return ContinueSentinel;
+ }
+
+ var record = tryCatch(method, delegate.iterator, context.arg);
+
+ if (record.type === "throw") {
+ context.method = "throw";
+ context.arg = record.arg;
+ context.delegate = null;
+ return ContinueSentinel;
+ }
+
+ var info = record.arg;
+
+ if (! info) {
+ context.method = "throw";
+ context.arg = new TypeError("iterator result is not an object");
+ context.delegate = null;
+ return ContinueSentinel;
+ }
+
+ if (info.done) {
+ // Assign the result of the finished delegate to the temporary
+ // variable specified by delegate.resultName (see delegateYield).
+ context[delegate.resultName] = info.value;
+
+ // Resume execution at the desired location (see delegateYield).
+ context.next = delegate.nextLoc;
+
+ // If context.method was "throw" but the delegate handled the
+ // exception, let the outer generator proceed normally. If
+ // context.method was "next", forget context.arg since it has been
+ // "consumed" by the delegate iterator. If context.method was
+ // "return", allow the original .return call to continue in the
+ // outer generator.
+ if (context.method !== "return") {
+ context.method = "next";
+ context.arg = undefined$1;
+ }
+
+ } else {
+ // Re-yield the result returned by the delegate method.
+ return info;
+ }
+
+ // The delegate iterator is finished, so forget it and continue with
+ // the outer generator.
+ context.delegate = null;
+ return ContinueSentinel;
+ }
+
+ // Define Generator.prototype.{next,throw,return} in terms of the
+ // unified ._invoke helper method.
+ defineIteratorMethods(Gp);
+
+ define(Gp, toStringTagSymbol, "Generator");
+
+ // A Generator should always return itself as the iterator object when the
+ // @@iterator function is called on it. Some browsers' implementations of the
+ // iterator prototype chain incorrectly implement this, causing the Generator
+ // object to not be returned from this call. This ensures that doesn't happen.
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
+ define(Gp, iteratorSymbol, function() {
+ return this;
+ });
+
+ define(Gp, "toString", function() {
+ return "[object Generator]";
+ });
+
+ function pushTryEntry(locs) {
+ var entry = { tryLoc: locs[0] };
+
+ if (1 in locs) {
+ entry.catchLoc = locs[1];
+ }
+
+ if (2 in locs) {
+ entry.finallyLoc = locs[2];
+ entry.afterLoc = locs[3];
+ }
+
+ this.tryEntries.push(entry);
+ }
+
+ function resetTryEntry(entry) {
+ var record = entry.completion || {};
+ record.type = "normal";
+ delete record.arg;
+ entry.completion = record;
+ }
+
+ function Context(tryLocsList) {
+ // The root entry object (effectively a try statement without a catch
+ // or a finally block) gives us a place to store values thrown from
+ // locations where there is no enclosing try statement.
+ this.tryEntries = [{ tryLoc: "root" }];
+ tryLocsList.forEach(pushTryEntry, this);
+ this.reset(true);
+ }
+
+ exports.keys = function(object) {
+ var keys = [];
+ for (var key in object) {
+ keys.push(key);
+ }
+ keys.reverse();
+
+ // Rather than returning an object with a next method, we keep
+ // things simple and return the next function itself.
+ return function next() {
+ while (keys.length) {
+ var key = keys.pop();
+ if (key in object) {
+ next.value = key;
+ next.done = false;
+ return next;
+ }
+ }
+
+ // To avoid creating an additional object, we just hang the .value
+ // and .done properties off the next function object itself. This
+ // also ensures that the minifier will not anonymize the function.
+ next.done = true;
+ return next;
+ };
+ };
+
+ function values(iterable) {
+ if (iterable) {
+ var iteratorMethod = iterable[iteratorSymbol];
+ if (iteratorMethod) {
+ return iteratorMethod.call(iterable);
+ }
+
+ if (typeof iterable.next === "function") {
+ return iterable;
+ }
+
+ if (!isNaN(iterable.length)) {
+ var i = -1, next = function next() {
+ while (++i < iterable.length) {
+ if (hasOwn.call(iterable, i)) {
+ next.value = iterable[i];
+ next.done = false;
+ return next;
+ }
+ }
+
+ next.value = undefined$1;
+ next.done = true;
+
+ return next;
+ };
+
+ return next.next = next;
+ }
+ }
+
+ // Return an iterator with no values.
+ return { next: doneResult };
+ }
+ exports.values = values;
+
+ function doneResult() {
+ return { value: undefined$1, done: true };
+ }
+
+ Context.prototype = {
+ constructor: Context,
+
+ reset: function(skipTempReset) {
+ this.prev = 0;
+ this.next = 0;
+ // Resetting context._sent for legacy support of Babel's
+ // function.sent implementation.
+ this.sent = this._sent = undefined$1;
+ this.done = false;
+ this.delegate = null;
+
+ this.method = "next";
+ this.arg = undefined$1;
+
+ this.tryEntries.forEach(resetTryEntry);
+
+ if (!skipTempReset) {
+ for (var name in this) {
+ // Not sure about the optimal order of these conditions:
+ if (name.charAt(0) === "t" &&
+ hasOwn.call(this, name) &&
+ !isNaN(+name.slice(1))) {
+ this[name] = undefined$1;
+ }
+ }
+ }
+ },
+
+ stop: function() {
+ this.done = true;
+
+ var rootEntry = this.tryEntries[0];
+ var rootRecord = rootEntry.completion;
+ if (rootRecord.type === "throw") {
+ throw rootRecord.arg;
+ }
+
+ return this.rval;
+ },
+
+ dispatchException: function(exception) {
+ if (this.done) {
+ throw exception;
+ }
+
+ var context = this;
+ function handle(loc, caught) {
+ record.type = "throw";
+ record.arg = exception;
+ context.next = loc;
+
+ if (caught) {
+ // If the dispatched exception was caught by a catch block,
+ // then let that catch block handle the exception normally.
+ context.method = "next";
+ context.arg = undefined$1;
+ }
+
+ return !! caught;
+ }
+
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ var record = entry.completion;
+
+ if (entry.tryLoc === "root") {
+ // Exception thrown outside of any try block that could handle
+ // it, so set the completion value of the entire function to
+ // throw the exception.
+ return handle("end");
+ }
+
+ if (entry.tryLoc <= this.prev) {
+ var hasCatch = hasOwn.call(entry, "catchLoc");
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
+
+ if (hasCatch && hasFinally) {
+ if (this.prev < entry.catchLoc) {
+ return handle(entry.catchLoc, true);
+ } else if (this.prev < entry.finallyLoc) {
+ return handle(entry.finallyLoc);
+ }
+
+ } else if (hasCatch) {
+ if (this.prev < entry.catchLoc) {
+ return handle(entry.catchLoc, true);
+ }
+
+ } else if (hasFinally) {
+ if (this.prev < entry.finallyLoc) {
+ return handle(entry.finallyLoc);
+ }
+
+ } else {
+ throw new Error("try statement without catch or finally");
+ }
+ }
+ }
+ },
+
+ abrupt: function(type, arg) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.tryLoc <= this.prev &&
+ hasOwn.call(entry, "finallyLoc") &&
+ this.prev < entry.finallyLoc) {
+ var finallyEntry = entry;
+ break;
+ }
+ }
+
+ if (finallyEntry &&
+ (type === "break" ||
+ type === "continue") &&
+ finallyEntry.tryLoc <= arg &&
+ arg <= finallyEntry.finallyLoc) {
+ // Ignore the finally entry if control is not jumping to a
+ // location outside the try/catch block.
+ finallyEntry = null;
+ }
+
+ var record = finallyEntry ? finallyEntry.completion : {};
+ record.type = type;
+ record.arg = arg;
+
+ if (finallyEntry) {
+ this.method = "next";
+ this.next = finallyEntry.finallyLoc;
+ return ContinueSentinel;
+ }
+
+ return this.complete(record);
+ },
+
+ complete: function(record, afterLoc) {
+ if (record.type === "throw") {
+ throw record.arg;
+ }
+
+ if (record.type === "break" ||
+ record.type === "continue") {
+ this.next = record.arg;
+ } else if (record.type === "return") {
+ this.rval = this.arg = record.arg;
+ this.method = "return";
+ this.next = "end";
+ } else if (record.type === "normal" && afterLoc) {
+ this.next = afterLoc;
+ }
+
+ return ContinueSentinel;
+ },
+
+ finish: function(finallyLoc) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.finallyLoc === finallyLoc) {
+ this.complete(entry.completion, entry.afterLoc);
+ resetTryEntry(entry);
+ return ContinueSentinel;
+ }
+ }
+ },
+
+ "catch": function(tryLoc) {
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+ var entry = this.tryEntries[i];
+ if (entry.tryLoc === tryLoc) {
+ var record = entry.completion;
+ if (record.type === "throw") {
+ var thrown = record.arg;
+ resetTryEntry(entry);
+ }
+ return thrown;
+ }
+ }
+
+ // The context.catch method must only be called with a location
+ // argument that corresponds to a known catch block.
+ throw new Error("illegal catch attempt");
+ },
+
+ delegateYield: function(iterable, resultName, nextLoc) {
+ this.delegate = {
+ iterator: values(iterable),
+ resultName: resultName,
+ nextLoc: nextLoc
+ };
+
+ if (this.method === "next") {
+ // Deliberately forget the last sent value so that we don't
+ // accidentally pass it on to the delegate.
+ this.arg = undefined$1;
+ }
+
+ return ContinueSentinel;
+ }
+ };
+
+ // Regardless of whether this script is executing as a CommonJS module
+ // or not, return the runtime object so that we can declare the variable
+ // regeneratorRuntime in the outer scope, which allows this module to be
+ // injected easily by `bin/regenerator --include-runtime script.js`.
+ return exports;
+
+ }(
+ // If this script is executing as a CommonJS module, use module.exports
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
+ // object. Either way, the resulting object will be used to initialize
+ // the regeneratorRuntime variable at the top of this file.
+ module.exports
+ ));
+
+ try {
+ regeneratorRuntime = runtime;
+ } catch (accidentalStrictMode) {
+ // This module should not be running in strict mode, so the above
+ // assignment should always work unless something is misconfigured. Just
+ // in case runtime.js accidentally runs in strict mode, in modern engines
+ // we can explicitly access globalThis. In older engines we can escape
+ // strict mode using a global Function call. This could conceivably fail
+ // if a Content Security Policy forbids using Function, but in that case
+ // the proper solution is to fix the accidental strict mode problem. If
+ // you've misconfigured your bundler to force strict mode and applied a
+ // CSP to forbid Function, and you're not willing to fix either of those
+ // problems, please detail your unique predicament in a GitHub issue.
+ if (typeof globalThis === "object") {
+ globalThis.regeneratorRuntime = runtime;
+ } else {
+ Function("r", "regeneratorRuntime = r")(runtime);
+ }
+ }
+ } (runtime));
- this.method = "next";
- this.arg = undefined$1;
-
- this.tryEntries.forEach(resetTryEntry);
-
- if (!skipTempReset) {
- for (var name in this) {
- // Not sure about the optimal order of these conditions:
- if (name.charAt(0) === "t" &&
- hasOwn.call(this, name) &&
- !isNaN(+name.slice(1))) {
- this[name] = undefined$1;
- }
- }
- }
- },
-
- stop: function() {
- this.done = true;
-
- var rootEntry = this.tryEntries[0];
- var rootRecord = rootEntry.completion;
- if (rootRecord.type === "throw") {
- throw rootRecord.arg;
- }
-
- return this.rval;
- },
-
- dispatchException: function(exception) {
- if (this.done) {
- throw exception;
- }
-
- var context = this;
- function handle(loc, caught) {
- record.type = "throw";
- record.arg = exception;
- context.next = loc;
-
- if (caught) {
- // If the dispatched exception was caught by a catch block,
- // then let that catch block handle the exception normally.
- context.method = "next";
- context.arg = undefined$1;
- }
-
- return !! caught;
- }
-
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- var record = entry.completion;
-
- if (entry.tryLoc === "root") {
- // Exception thrown outside of any try block that could handle
- // it, so set the completion value of the entire function to
- // throw the exception.
- return handle("end");
- }
-
- if (entry.tryLoc <= this.prev) {
- var hasCatch = hasOwn.call(entry, "catchLoc");
- var hasFinally = hasOwn.call(entry, "finallyLoc");
-
- if (hasCatch && hasFinally) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- } else if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
-
- } else if (hasCatch) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- }
-
- } else if (hasFinally) {
- if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
-
- } else {
- throw new Error("try statement without catch or finally");
- }
- }
- }
- },
-
- abrupt: function(type, arg) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc <= this.prev &&
- hasOwn.call(entry, "finallyLoc") &&
- this.prev < entry.finallyLoc) {
- var finallyEntry = entry;
- break;
- }
- }
-
- if (finallyEntry &&
- (type === "break" ||
- type === "continue") &&
- finallyEntry.tryLoc <= arg &&
- arg <= finallyEntry.finallyLoc) {
- // Ignore the finally entry if control is not jumping to a
- // location outside the try/catch block.
- finallyEntry = null;
- }
-
- var record = finallyEntry ? finallyEntry.completion : {};
- record.type = type;
- record.arg = arg;
-
- if (finallyEntry) {
- this.method = "next";
- this.next = finallyEntry.finallyLoc;
- return ContinueSentinel;
- }
-
- return this.complete(record);
- },
-
- complete: function(record, afterLoc) {
- if (record.type === "throw") {
- throw record.arg;
- }
-
- if (record.type === "break" ||
- record.type === "continue") {
- this.next = record.arg;
- } else if (record.type === "return") {
- this.rval = this.arg = record.arg;
- this.method = "return";
- this.next = "end";
- } else if (record.type === "normal" && afterLoc) {
- this.next = afterLoc;
- }
-
- return ContinueSentinel;
- },
-
- finish: function(finallyLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.finallyLoc === finallyLoc) {
- this.complete(entry.completion, entry.afterLoc);
- resetTryEntry(entry);
- return ContinueSentinel;
- }
- }
- },
-
- "catch": function(tryLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc === tryLoc) {
- var record = entry.completion;
- if (record.type === "throw") {
- var thrown = record.arg;
- resetTryEntry(entry);
- }
- return thrown;
- }
- }
-
- // The context.catch method must only be called with a location
- // argument that corresponds to a known catch block.
- throw new Error("illegal catch attempt");
- },
-
- delegateYield: function(iterable, resultName, nextLoc) {
- this.delegate = {
- iterator: values(iterable),
- resultName: resultName,
- nextLoc: nextLoc
- };
-
- if (this.method === "next") {
- // Deliberately forget the last sent value so that we don't
- // accidentally pass it on to the delegate.
- this.arg = undefined$1;
- }
-
- return ContinueSentinel;
- }
- };
-
- // Regardless of whether this script is executing as a CommonJS module
- // or not, return the runtime object so that we can declare the variable
- // regeneratorRuntime in the outer scope, which allows this module to be
- // injected easily by `bin/regenerator --include-runtime script.js`.
- return exports;
-
- }(
- // If this script is executing as a CommonJS module, use module.exports
- // as the regeneratorRuntime namespace. Otherwise create a new empty
- // object. Either way, the resulting object will be used to initialize
- // the regeneratorRuntime variable at the top of this file.
- module.exports
- ));
-
- try {
- regeneratorRuntime = runtime;
- } catch (accidentalStrictMode) {
- // This module should not be running in strict mode, so the above
- // assignment should always work unless something is misconfigured. Just
- // in case runtime.js accidentally runs in strict mode, in modern engines
- // we can explicitly access globalThis. In older engines we can escape
- // strict mode using a global Function call. This could conceivably fail
- // if a Content Security Policy forbids using Function, but in that case
- // the proper solution is to fix the accidental strict mode problem. If
- // you've misconfigured your bundler to force strict mode and applied a
- // CSP to forbid Function, and you're not willing to fix either of those
- // problems, please detail your unique predicament in a GitHub issue.
- if (typeof globalThis === "object") {
- globalThis.regeneratorRuntime = runtime;
- } else {
- Function("r", "regeneratorRuntime = r")(runtime);
- }
- }
- }(runtime));
+ (function (module) {
+ module.exports = runtime.exports;
+ } (regenerator));
- var regenerator = runtime.exports;
+ var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator.exports);
var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
@@ -1443,12 +1439,17 @@
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
- Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined
+ Buffer$1.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined
? global$1.TYPED_ARRAY_SUPPORT
: true;
+ /*
+ * Export kMaxLength after typed array support is determined.
+ */
+ kMaxLength();
+
function kMaxLength () {
- return Buffer.TYPED_ARRAY_SUPPORT
+ return Buffer$1.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
@@ -1457,14 +1458,14 @@
if (kMaxLength() < length) {
throw new RangeError('Invalid typed array length')
}
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array(length);
- that.__proto__ = Buffer.prototype;
+ that.__proto__ = Buffer$1.prototype;
} else {
// Fallback: Return an object instance of the Buffer class
if (that === null) {
- that = new Buffer(length);
+ that = new Buffer$1(length);
}
that.length = length;
}
@@ -1482,9 +1483,9 @@
* The `Uint8Array` prototype remains unmodified.
*/
- function Buffer (arg, encodingOrOffset, length) {
- if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
- return new Buffer(arg, encodingOrOffset, length)
+ function Buffer$1 (arg, encodingOrOffset, length) {
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$1)) {
+ return new Buffer$1(arg, encodingOrOffset, length)
}
// Common case.
@@ -1499,11 +1500,11 @@
return from(this, arg, encodingOrOffset, length)
}
- Buffer.poolSize = 8192; // not used by this implementation
+ Buffer$1.poolSize = 8192; // not used by this implementation
// TODO: Legacy, not needed anymore. Remove in next major version.
- Buffer._augment = function (arr) {
- arr.__proto__ = Buffer.prototype;
+ Buffer$1._augment = function (arr) {
+ arr.__proto__ = Buffer$1.prototype;
return arr
};
@@ -1531,13 +1532,13 @@
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
- Buffer.from = function (value, encodingOrOffset, length) {
+ Buffer$1.from = function (value, encodingOrOffset, length) {
return from(null, value, encodingOrOffset, length)
};
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- Buffer.prototype.__proto__ = Uint8Array.prototype;
- Buffer.__proto__ = Uint8Array;
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
+ Buffer$1.prototype.__proto__ = Uint8Array.prototype;
+ Buffer$1.__proto__ = Uint8Array;
}
function assertSize (size) {
@@ -1568,14 +1569,14 @@
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
- Buffer.alloc = function (size, fill, encoding) {
+ Buffer$1.alloc = function (size, fill, encoding) {
return alloc(null, size, fill, encoding)
};
function allocUnsafe (that, size) {
assertSize(size);
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; ++i) {
that[i] = 0;
}
@@ -1586,13 +1587,13 @@
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
- Buffer.allocUnsafe = function (size) {
+ Buffer$1.allocUnsafe = function (size) {
return allocUnsafe(null, size)
};
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
- Buffer.allocUnsafeSlow = function (size) {
+ Buffer$1.allocUnsafeSlow = function (size) {
return allocUnsafe(null, size)
};
@@ -1601,7 +1602,7 @@
encoding = 'utf8';
}
- if (!Buffer.isEncoding(encoding)) {
+ if (!Buffer$1.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
@@ -1648,10 +1649,10 @@
array = new Uint8Array(array, byteOffset, length);
}
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = array;
- that.__proto__ = Buffer.prototype;
+ that.__proto__ = Buffer$1.prototype;
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike(that, array);
@@ -1698,12 +1699,12 @@
}
return length | 0
}
- Buffer.isBuffer = isBuffer;
+ Buffer$1.isBuffer = isBuffer;
function internalIsBuffer (b) {
return !!(b != null && b._isBuffer)
}
- Buffer.compare = function compare (a, b) {
+ Buffer$1.compare = function compare (a, b) {
if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
@@ -1726,7 +1727,7 @@
return 0
};
- Buffer.isEncoding = function isEncoding (encoding) {
+ Buffer$1.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
@@ -1745,13 +1746,13 @@
}
};
- Buffer.concat = function concat (list, length) {
+ Buffer$1.concat = function concat (list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
- return Buffer.alloc(0)
+ return Buffer$1.alloc(0)
}
var i;
@@ -1762,7 +1763,7 @@
}
}
- var buffer = Buffer.allocUnsafe(length);
+ var buffer = Buffer$1.allocUnsafe(length);
var pos = 0;
for (i = 0; i < list.length; ++i) {
var buf = list[i];
@@ -1818,7 +1819,7 @@
}
}
}
- Buffer.byteLength = byteLength;
+ Buffer$1.byteLength = byteLength;
function slowToString (encoding, start, end) {
var loweredCase = false;
@@ -1892,7 +1893,7 @@
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
- Buffer.prototype._isBuffer = true;
+ Buffer$1.prototype._isBuffer = true;
function swap (b, n, m) {
var i = b[n];
@@ -1900,7 +1901,7 @@
b[m] = i;
}
- Buffer.prototype.swap16 = function swap16 () {
+ Buffer$1.prototype.swap16 = function swap16 () {
var len = this.length;
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
@@ -1911,7 +1912,7 @@
return this
};
- Buffer.prototype.swap32 = function swap32 () {
+ Buffer$1.prototype.swap32 = function swap32 () {
var len = this.length;
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
@@ -1923,7 +1924,7 @@
return this
};
- Buffer.prototype.swap64 = function swap64 () {
+ Buffer$1.prototype.swap64 = function swap64 () {
var len = this.length;
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
@@ -1937,20 +1938,20 @@
return this
};
- Buffer.prototype.toString = function toString () {
+ Buffer$1.prototype.toString = function toString () {
var length = this.length | 0;
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
};
- Buffer.prototype.equals = function equals (b) {
+ Buffer$1.prototype.equals = function equals (b) {
if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
- return Buffer.compare(this, b) === 0
+ return Buffer$1.compare(this, b) === 0
};
- Buffer.prototype.inspect = function inspect () {
+ Buffer$1.prototype.inspect = function inspect () {
var str = '';
var max = INSPECT_MAX_BYTES;
if (this.length > 0) {
@@ -1960,7 +1961,7 @@
return ''
};
- Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
+ Buffer$1.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!internalIsBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
@@ -2059,7 +2060,7 @@
// Normalize val
if (typeof val === 'string') {
- val = Buffer.from(val, encoding);
+ val = Buffer$1.from(val, encoding);
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
@@ -2071,7 +2072,7 @@
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF; // Search for a byte value [0-255]
- if (Buffer.TYPED_ARRAY_SUPPORT &&
+ if (Buffer$1.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
@@ -2141,15 +2142,15 @@
return -1
}
- Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
+ Buffer$1.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
};
- Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
+ Buffer$1.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
};
- Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
+ Buffer$1.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
};
@@ -2200,7 +2201,7 @@
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
- Buffer.prototype.write = function write (string, offset, length, encoding) {
+ Buffer$1.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8';
@@ -2272,7 +2273,7 @@
}
};
- Buffer.prototype.toJSON = function toJSON () {
+ Buffer$1.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
@@ -2425,7 +2426,7 @@
return res
}
- Buffer.prototype.slice = function slice (start, end) {
+ Buffer$1.prototype.slice = function slice (start, end) {
var len = this.length;
start = ~~start;
end = end === undefined ? len : ~~end;
@@ -2447,12 +2448,12 @@
if (end < start) end = start;
var newBuf;
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
newBuf = this.subarray(start, end);
- newBuf.__proto__ = Buffer.prototype;
+ newBuf.__proto__ = Buffer$1.prototype;
} else {
var sliceLen = end - start;
- newBuf = new Buffer(sliceLen, undefined);
+ newBuf = new Buffer$1(sliceLen, undefined);
for (var i = 0; i < sliceLen; ++i) {
newBuf[i] = this[i + start];
}
@@ -2469,7 +2470,7 @@
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
- Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ Buffer$1.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0;
byteLength = byteLength | 0;
if (!noAssert) checkOffset(offset, byteLength, this.length);
@@ -2484,7 +2485,7 @@
return val
};
- Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ Buffer$1.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0;
byteLength = byteLength | 0;
if (!noAssert) {
@@ -2500,22 +2501,22 @@
return val
};
- Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ Buffer$1.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length);
return this[offset]
};
- Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ Buffer$1.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length);
return this[offset] | (this[offset + 1] << 8)
};
- Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ Buffer$1.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length);
return (this[offset] << 8) | this[offset + 1]
};
- Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ Buffer$1.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length);
return ((this[offset]) |
@@ -2524,7 +2525,7 @@
(this[offset + 3] * 0x1000000)
};
- Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ Buffer$1.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length);
return (this[offset] * 0x1000000) +
@@ -2533,7 +2534,7 @@
this[offset + 3])
};
- Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ Buffer$1.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0;
byteLength = byteLength | 0;
if (!noAssert) checkOffset(offset, byteLength, this.length);
@@ -2551,7 +2552,7 @@
return val
};
- Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ Buffer$1.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0;
byteLength = byteLength | 0;
if (!noAssert) checkOffset(offset, byteLength, this.length);
@@ -2569,25 +2570,25 @@
return val
};
- Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ Buffer$1.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length);
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
};
- Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ Buffer$1.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length);
var val = this[offset] | (this[offset + 1] << 8);
return (val & 0x8000) ? val | 0xFFFF0000 : val
};
- Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ Buffer$1.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length);
var val = this[offset + 1] | (this[offset] << 8);
return (val & 0x8000) ? val | 0xFFFF0000 : val
};
- Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ Buffer$1.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length);
return (this[offset]) |
@@ -2596,7 +2597,7 @@
(this[offset + 3] << 24)
};
- Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ Buffer$1.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length);
return (this[offset] << 24) |
@@ -2605,22 +2606,22 @@
(this[offset + 3])
};
- Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ Buffer$1.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length);
return read$1(this, offset, true, 23, 4)
};
- Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ Buffer$1.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length);
return read$1(this, offset, false, 23, 4)
};
- Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ Buffer$1.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length);
return read$1(this, offset, true, 52, 8)
};
- Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ Buffer$1.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length);
return read$1(this, offset, false, 52, 8)
};
@@ -2631,7 +2632,7 @@
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
- Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ Buffer$1.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value;
offset = offset | 0;
byteLength = byteLength | 0;
@@ -2650,7 +2651,7 @@
return offset + byteLength
};
- Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ Buffer$1.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value;
offset = offset | 0;
byteLength = byteLength | 0;
@@ -2669,11 +2670,11 @@
return offset + byteLength
};
- Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ Buffer$1.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
this[offset] = (value & 0xff);
return offset + 1
};
@@ -2686,11 +2687,11 @@
}
}
- Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ Buffer$1.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff);
this[offset + 1] = (value >>> 8);
} else {
@@ -2699,11 +2700,11 @@
return offset + 2
};
- Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ Buffer$1.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8);
this[offset + 1] = (value & 0xff);
} else {
@@ -2719,11 +2720,11 @@
}
}
- Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ Buffer$1.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24);
this[offset + 2] = (value >>> 16);
this[offset + 1] = (value >>> 8);
@@ -2734,11 +2735,11 @@
return offset + 4
};
- Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ Buffer$1.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
@@ -2749,7 +2750,7 @@
return offset + 4
};
- Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ Buffer$1.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) {
@@ -2772,7 +2773,7 @@
return offset + byteLength
};
- Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ Buffer$1.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) {
@@ -2795,21 +2796,21 @@
return offset + byteLength
};
- Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ Buffer$1.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
+ if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
if (value < 0) value = 0xff + value + 1;
this[offset] = (value & 0xff);
return offset + 1
};
- Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ Buffer$1.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff);
this[offset + 1] = (value >>> 8);
} else {
@@ -2818,11 +2819,11 @@
return offset + 2
};
- Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ Buffer$1.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8);
this[offset + 1] = (value & 0xff);
} else {
@@ -2831,11 +2832,11 @@
return offset + 2
};
- Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ Buffer$1.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff);
this[offset + 1] = (value >>> 8);
this[offset + 2] = (value >>> 16);
@@ -2846,12 +2847,12 @@
return offset + 4
};
- Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ Buffer$1.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value;
offset = offset | 0;
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
if (value < 0) value = 0xffffffff + value + 1;
- if (Buffer.TYPED_ARRAY_SUPPORT) {
+ if (Buffer$1.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
@@ -2875,11 +2876,11 @@
return offset + 4
}
- Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ Buffer$1.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
};
- Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ Buffer$1.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
};
@@ -2891,16 +2892,16 @@
return offset + 8
}
- Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ Buffer$1.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
};
- Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ Buffer$1.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
};
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
- Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ Buffer$1.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0;
if (!end && end !== 0) end = this.length;
if (targetStart >= target.length) targetStart = target.length;
@@ -2932,7 +2933,7 @@
for (i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start];
}
- } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
+ } else if (len < 1000 || !Buffer$1.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; ++i) {
target[i + targetStart] = this[i + start];
@@ -2952,7 +2953,7 @@
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
- Buffer.prototype.fill = function fill (val, start, end, encoding) {
+ Buffer$1.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
@@ -2972,7 +2973,7 @@
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ if (typeof encoding === 'string' && !Buffer$1.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
} else if (typeof val === 'number') {
@@ -3001,7 +3002,7 @@
} else {
var bytes = internalIsBuffer(val)
? val
- : utf8ToBytes(new Buffer(val, encoding).toString());
+ : utf8ToBytes(new Buffer$1(val, encoding).toString());
var len = bytes.length;
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len];
@@ -3115,1563 +3116,2358 @@
}
}
- return bytes
- }
+ return bytes
+ }
+
+ function asciiToBytes (str) {
+ var byteArray = [];
+ for (var i = 0; i < str.length; ++i) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF);
+ }
+ return byteArray
+ }
+
+ function utf16leToBytes (str, units) {
+ var c, hi, lo;
+ var byteArray = [];
+ for (var i = 0; i < str.length; ++i) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i);
+ hi = c >> 8;
+ lo = c % 256;
+ byteArray.push(lo);
+ byteArray.push(hi);
+ }
+
+ return byteArray
+ }
+
+
+ function base64ToBytes (str) {
+ return toByteArray(base64clean(str))
+ }
+
+ function blitBuffer (src, dst, offset, length) {
+ for (var i = 0; i < length; ++i) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i];
+ }
+ return i
+ }
+
+ function isnan (val) {
+ return val !== val // eslint-disable-line no-self-compare
+ }
+
+
+ // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
+ // The _isBuffer check is for Safari 5-7 support, because it's missing
+ // Object.prototype.constructor. Remove this eventually
+ function isBuffer(obj) {
+ return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
+ }
+
+ function isFastBuffer (obj) {
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+ }
+
+ // For Node v0.10 support. Remove this eventually.
+ function isSlowBuffer (obj) {
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
+ }
+
+ let decoder;
+ try {
+ decoder = new TextDecoder();
+ } catch(error) {}
+ let src;
+ let srcEnd;
+ let position$1 = 0;
+ const LEGACY_RECORD_INLINE_ID = 105;
+ const RECORD_DEFINITIONS_ID = 0xdffe;
+ const RECORD_INLINE_ID = 0xdfff; // temporary first-come first-serve tag // proposed tag: 0x7265 // 're'
+ const BUNDLED_STRINGS_ID = 0xdff9;
+ const PACKED_REFERENCE_TAG_ID = 6;
+ const STOP_CODE = {};
+ let currentDecoder = {};
+ let currentStructures;
+ let srcString;
+ let srcStringStart = 0;
+ let srcStringEnd = 0;
+ let bundledStrings$1;
+ let referenceMap;
+ let currentExtensions = [];
+ let currentExtensionRanges = [];
+ let packedValues;
+ let dataView;
+ let restoreMapsAsObject;
+ let defaultOptions = {
+ useRecords: false,
+ mapsAsObjects: true
+ };
+ let sequentialMode = false;
+ let inlineObjectReadThreshold = 2;
+ // no-eval build
+ try {
+ new Function('');
+ } catch(error) {
+ // if eval variants are not supported, do not create inline object readers ever
+ inlineObjectReadThreshold = Infinity;
+ }
+
+
+
+ class Decoder {
+ constructor(options) {
+ if (options) {
+ if ((options.keyMap || options._keyMap) && !options.useRecords) {
+ options.useRecords = false;
+ options.mapsAsObjects = true;
+ }
+ if (options.useRecords === false && options.mapsAsObjects === undefined)
+ options.mapsAsObjects = true;
+ if (options.getStructures)
+ options.getShared = options.getStructures;
+ if (options.getShared && !options.structures)
+ (options.structures = []).uninitialized = true; // this is what we use to denote an uninitialized structures
+ if (options.keyMap) {
+ this.mapKey = new Map();
+ for (let [k,v] of Object.entries(options.keyMap)) this.mapKey.set(v,k);
+ }
+ }
+ Object.assign(this, options);
+ }
+ /*
+ decodeKey(key) {
+ return this.keyMap
+ ? Object.keys(this.keyMap)[Object.values(this.keyMap).indexOf(key)] || key
+ : key
+ }
+ */
+ decodeKey(key) {
+ return this.keyMap ? this.mapKey.get(key) || key : key
+ }
+
+ encodeKey(key) {
+ return this.keyMap && this.keyMap.hasOwnProperty(key) ? this.keyMap[key] : key
+ }
+
+ encodeKeys(rec) {
+ if (!this._keyMap) return rec
+ let map = new Map();
+ for (let [k,v] of Object.entries(rec)) map.set((this._keyMap.hasOwnProperty(k) ? this._keyMap[k] : k), v);
+ return map
+ }
+
+ decodeKeys(map) {
+ if (!this._keyMap || map.constructor.name != 'Map') return map
+ if (!this._mapKey) {
+ this._mapKey = new Map();
+ for (let [k,v] of Object.entries(this._keyMap)) this._mapKey.set(v,k);
+ }
+ let res = {};
+ //map.forEach((v,k) => res[Object.keys(this._keyMap)[Object.values(this._keyMap).indexOf(k)] || k] = v)
+ map.forEach((v,k) => res[safeKey(this._mapKey.has(k) ? this._mapKey.get(k) : k)] = v);
+ return res
+ }
+
+ mapDecode(source, end) {
+
+ let res = this.decode(source);
+ if (this._keyMap) {
+ //Experiemntal support for Optimised KeyMap decoding
+ switch (res.constructor.name) {
+ case 'Array': return res.map(r => this.decodeKeys(r))
+ //case 'Map': return this.decodeKeys(res)
+ }
+ }
+ return res
+ }
+
+ decode(source, end) {
+ if (src) {
+ // re-entrant execution, save the state and restore it after we do this decode
+ return saveState(() => {
+ clearSource();
+ return this ? this.decode(source, end) : Decoder.prototype.decode.call(defaultOptions, source, end)
+ })
+ }
+ srcEnd = end > -1 ? end : source.length;
+ position$1 = 0;
+ srcStringEnd = 0;
+ srcString = null;
+ bundledStrings$1 = null;
+ src = source;
+ // this provides cached access to the data view for a buffer if it is getting reused, which is a recommend
+ // technique for getting data from a database where it can be copied into an existing buffer instead of creating
+ // new ones
+ try {
+ dataView = source.dataView || (source.dataView = new DataView(source.buffer, source.byteOffset, source.byteLength));
+ } catch(error) {
+ // if it doesn't have a buffer, maybe it is the wrong type of object
+ src = null;
+ if (source instanceof Uint8Array)
+ throw error
+ throw new Error('Source must be a Uint8Array or Buffer but was a ' + ((source && typeof source == 'object') ? source.constructor.name : typeof source))
+ }
+ if (this instanceof Decoder) {
+ currentDecoder = this;
+ packedValues = this.sharedValues &&
+ (this.pack ? new Array(this.maxPrivatePackedValues || 16).concat(this.sharedValues) :
+ this.sharedValues);
+ if (this.structures) {
+ currentStructures = this.structures;
+ return checkedRead()
+ } else if (!currentStructures || currentStructures.length > 0) {
+ currentStructures = [];
+ }
+ } else {
+ currentDecoder = defaultOptions;
+ if (!currentStructures || currentStructures.length > 0)
+ currentStructures = [];
+ packedValues = null;
+ }
+ return checkedRead()
+ }
+ decodeMultiple(source, forEach) {
+ let values, lastPosition = 0;
+ try {
+ let size = source.length;
+ sequentialMode = true;
+ let value = this ? this.decode(source, size) : defaultDecoder.decode(source, size);
+ if (forEach) {
+ if (forEach(value) === false) {
+ return
+ }
+ while(position$1 < size) {
+ lastPosition = position$1;
+ if (forEach(checkedRead()) === false) {
+ return
+ }
+ }
+ }
+ else {
+ values = [ value ];
+ while(position$1 < size) {
+ lastPosition = position$1;
+ values.push(checkedRead());
+ }
+ return values
+ }
+ } catch(error) {
+ error.lastPosition = lastPosition;
+ error.values = values;
+ throw error
+ } finally {
+ sequentialMode = false;
+ clearSource();
+ }
+ }
+ }
+ function checkedRead() {
+ try {
+ let result = read();
+ if (bundledStrings$1) {
+ if (position$1 >= bundledStrings$1.postBundlePosition) {
+ let error = new Error('Unexpected bundle position');
+ error.incomplete = true;
+ throw error
+ }
+ // bundled strings to skip past
+ position$1 = bundledStrings$1.postBundlePosition;
+ bundledStrings$1 = null;
+ }
+
+ if (position$1 == srcEnd) {
+ // finished reading this source, cleanup references
+ currentStructures = null;
+ src = null;
+ if (referenceMap)
+ referenceMap = null;
+ } else if (position$1 > srcEnd) {
+ // over read
+ let error = new Error('Unexpected end of CBOR data');
+ error.incomplete = true;
+ throw error
+ } else if (!sequentialMode) {
+ throw new Error('Data read, but end of buffer not reached')
+ }
+ // else more to read, but we are reading sequentially, so don't clear source yet
+ return result
+ } catch(error) {
+ clearSource();
+ if (error instanceof RangeError || error.message.startsWith('Unexpected end of buffer')) {
+ error.incomplete = true;
+ }
+ throw error
+ }
+ }
+
+ function read() {
+ let token = src[position$1++];
+ let majorType = token >> 5;
+ token = token & 0x1f;
+ if (token > 0x17) {
+ switch (token) {
+ case 0x18:
+ token = src[position$1++];
+ break
+ case 0x19:
+ if (majorType == 7) {
+ return getFloat16()
+ }
+ token = dataView.getUint16(position$1);
+ position$1 += 2;
+ break
+ case 0x1a:
+ if (majorType == 7) {
+ let value = dataView.getFloat32(position$1);
+ if (currentDecoder.useFloat32 > 2) {
+ // this does rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
+ let multiplier = mult10[((src[position$1] & 0x7f) << 1) | (src[position$1 + 1] >> 7)];
+ position$1 += 4;
+ return ((multiplier * value + (value > 0 ? 0.5 : -0.5)) >> 0) / multiplier
+ }
+ position$1 += 4;
+ return value
+ }
+ token = dataView.getUint32(position$1);
+ position$1 += 4;
+ break
+ case 0x1b:
+ if (majorType == 7) {
+ let value = dataView.getFloat64(position$1);
+ position$1 += 8;
+ return value
+ }
+ if (majorType > 1) {
+ if (dataView.getUint32(position$1) > 0)
+ throw new Error('JavaScript does not support arrays, maps, or strings with length over 4294967295')
+ token = dataView.getUint32(position$1 + 4);
+ } else if (currentDecoder.int64AsNumber) {
+ token = dataView.getUint32(position$1) * 0x100000000;
+ token += dataView.getUint32(position$1 + 4);
+ } else
+ token = dataView.getBigUint64(position$1);
+ position$1 += 8;
+ break
+ case 0x1f:
+ // indefinite length
+ switch(majorType) {
+ case 2: // byte string
+ case 3: // text string
+ throw new Error('Indefinite length not supported for byte or text strings')
+ case 4: // array
+ let array = [];
+ let value, i = 0;
+ while ((value = read()) != STOP_CODE) {
+ array[i++] = value;
+ }
+ return majorType == 4 ? array : majorType == 3 ? array.join('') : Buffer$1.concat(array)
+ case 5: // map
+ let key;
+ if (currentDecoder.mapsAsObjects) {
+ let object = {};
+ if (currentDecoder.keyMap) while((key = read()) != STOP_CODE) object[safeKey(currentDecoder.decodeKey(key))] = read();
+ else while ((key = read()) != STOP_CODE) object[safeKey(key)] = read();
+ return object
+ } else {
+ if (restoreMapsAsObject) {
+ currentDecoder.mapsAsObjects = true;
+ restoreMapsAsObject = false;
+ }
+ let map = new Map();
+ if (currentDecoder.keyMap) while((key = read()) != STOP_CODE) map.set(currentDecoder.decodeKey(key), read());
+ else while ((key = read()) != STOP_CODE) map.set(key, read());
+ return map
+ }
+ case 7:
+ return STOP_CODE
+ default:
+ throw new Error('Invalid major type for indefinite length ' + majorType)
+ }
+ default:
+ throw new Error('Unknown token ' + token)
+ }
+ }
+ switch (majorType) {
+ case 0: // positive int
+ return token
+ case 1: // negative int
+ return ~token
+ case 2: // buffer
+ return readBin(token)
+ case 3: // string
+ if (srcStringEnd >= position$1) {
+ return srcString.slice(position$1 - srcStringStart, (position$1 += token) - srcStringStart)
+ }
+ if (srcStringEnd == 0 && srcEnd < 140 && token < 32) {
+ // for small blocks, avoiding the overhead of the extract call is helpful
+ let string = token < 16 ? shortStringInJS(token) : longStringInJS(token);
+ if (string != null)
+ return string
+ }
+ return readFixedString(token)
+ case 4: // array
+ let array = new Array(token);
+ //if (currentDecoder.keyMap) for (let i = 0; i < token; i++) array[i] = currentDecoder.decodeKey(read())
+ //else
+ for (let i = 0; i < token; i++) array[i] = read();
+ return array
+ case 5: // map
+ if (currentDecoder.mapsAsObjects) {
+ let object = {};
+ if (currentDecoder.keyMap) for (let i = 0; i < token; i++) object[safeKey(currentDecoder.decodeKey(read()))] = read();
+ else for (let i = 0; i < token; i++) object[safeKey(read())] = read();
+ return object
+ } else {
+ if (restoreMapsAsObject) {
+ currentDecoder.mapsAsObjects = true;
+ restoreMapsAsObject = false;
+ }
+ let map = new Map();
+ if (currentDecoder.keyMap) for (let i = 0; i < token; i++) map.set(currentDecoder.decodeKey(read()),read());
+ else for (let i = 0; i < token; i++) map.set(read(), read());
+ return map
+ }
+ case 6: // extension
+ if (token >= BUNDLED_STRINGS_ID) {
+ let structure = currentStructures[token & 0x1fff]; // check record structures first
+ // At some point we may provide an option for dynamic tag assignment with a range like token >= 8 && (token < 16 || (token > 0x80 && token < 0xc0) || (token > 0x130 && token < 0x4000))
+ if (structure) {
+ if (!structure.read) structure.read = createStructureReader(structure);
+ return structure.read()
+ }
+ if (token < 0x10000) {
+ if (token == RECORD_INLINE_ID) { // we do a special check for this so that we can keep the
+ // currentExtensions as densely stored array (v8 stores arrays densely under about 3000 elements)
+ let length = readJustLength();
+ let id = read();
+ let structure = read();
+ recordDefinition(id, structure);
+ let object = {};
+ if (currentDecoder.keyMap) for (let i = 2; i < length; i++) {
+ let key = currentDecoder.decodeKey(structure[i - 2]);
+ object[safeKey(key)] = read();
+ }
+ else for (let i = 2; i < length; i++) {
+ let key = structure[i - 2];
+ object[safeKey(key)] = read();
+ }
+ return object
+ }
+ else if (token == RECORD_DEFINITIONS_ID) {
+ let length = readJustLength();
+ let id = read();
+ for (let i = 2; i < length; i++) {
+ recordDefinition(id++, read());
+ }
+ return read()
+ } else if (token == BUNDLED_STRINGS_ID) {
+ return readBundleExt()
+ }
+ if (currentDecoder.getShared) {
+ loadShared();
+ structure = currentStructures[token & 0x1fff];
+ if (structure) {
+ if (!structure.read)
+ structure.read = createStructureReader(structure);
+ return structure.read()
+ }
+ }
+ }
+ }
+ let extension = currentExtensions[token];
+ if (extension) {
+ if (extension.handlesRead)
+ return extension(read)
+ else
+ return extension(read())
+ } else {
+ let input = read();
+ for (let i = 0; i < currentExtensionRanges.length; i++) {
+ let value = currentExtensionRanges[i](token, input);
+ if (value !== undefined)
+ return value
+ }
+ return new Tag(input, token)
+ }
+ case 7: // fixed value
+ switch (token) {
+ case 0x14: return false
+ case 0x15: return true
+ case 0x16: return null
+ case 0x17: return; // undefined
+ case 0x1f:
+ default:
+ let packedValue = (packedValues || getPackedValues())[token];
+ if (packedValue !== undefined)
+ return packedValue
+ throw new Error('Unknown token ' + token)
+ }
+ default: // negative int
+ if (isNaN(token)) {
+ let error = new Error('Unexpected end of CBOR data');
+ error.incomplete = true;
+ throw error
+ }
+ throw new Error('Unknown CBOR token ' + token)
+ }
+ }
+ const validName = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
+ function createStructureReader(structure) {
+ function readObject() {
+ // get the array size from the header
+ let length = src[position$1++];
+ //let majorType = token >> 5
+ length = length & 0x1f;
+ if (length > 0x17) {
+ switch (length) {
+ case 0x18:
+ length = src[position$1++];
+ break
+ case 0x19:
+ length = dataView.getUint16(position$1);
+ position$1 += 2;
+ break
+ case 0x1a:
+ length = dataView.getUint32(position$1);
+ position$1 += 4;
+ break
+ default:
+ throw new Error('Expected array header, but got ' + src[position$1 - 1])
+ }
+ }
+ // This initial function is quick to instantiate, but runs slower. After several iterations pay the cost to build the faster function
+ let compiledReader = this.compiledReader; // first look to see if we have the fast compiled function
+ while(compiledReader) {
+ // we have a fast compiled object literal reader
+ if (compiledReader.propertyCount === length)
+ return compiledReader(read) // with the right length, so we use it
+ compiledReader = compiledReader.next; // see if there is another reader with the right length
+ }
+ if (this.slowReads++ >= inlineObjectReadThreshold) { // create a fast compiled reader
+ let array = this.length == length ? this : this.slice(0, length);
+ compiledReader = currentDecoder.keyMap
+ ? new Function('r', 'return {' + array.map(k => currentDecoder.decodeKey(k)).map(k => validName.test(k) ? safeKey(k) + ':r()' : ('[' + JSON.stringify(k) + ']:r()')).join(',') + '}')
+ : new Function('r', 'return {' + array.map(key => validName.test(key) ? safeKey(key) + ':r()' : ('[' + JSON.stringify(key) + ']:r()')).join(',') + '}');
+ if (this.compiledReader)
+ compiledReader.next = this.compiledReader; // if there is an existing one, we store multiple readers as a linked list because it is usually pretty rare to have multiple readers (of different length) for the same structure
+ compiledReader.propertyCount = length;
+ this.compiledReader = compiledReader;
+ return compiledReader(read)
+ }
+ let object = {};
+ if (currentDecoder.keyMap) for (let i = 0; i < length; i++) object[safeKey(currentDecoder.decodeKey(this[i]))] = read();
+ else for (let i = 0; i < length; i++) {
+ object[safeKey(this[i])] = read();
+ }
+ return object
+ }
+ structure.slowReads = 0;
+ return readObject
+ }
+
+ function safeKey(key) {
+ return key === '__proto__' ? '__proto_' : key
+ }
+
+ let readFixedString = readStringJS;
+ function readStringJS(length) {
+ let result;
+ if (length < 16) {
+ if (result = shortStringInJS(length))
+ return result
+ }
+ if (length > 64 && decoder)
+ return decoder.decode(src.subarray(position$1, position$1 += length))
+ const end = position$1 + length;
+ const units = [];
+ result = '';
+ while (position$1 < end) {
+ const byte1 = src[position$1++];
+ if ((byte1 & 0x80) === 0) {
+ // 1 byte
+ units.push(byte1);
+ } else if ((byte1 & 0xe0) === 0xc0) {
+ // 2 bytes
+ const byte2 = src[position$1++] & 0x3f;
+ units.push(((byte1 & 0x1f) << 6) | byte2);
+ } else if ((byte1 & 0xf0) === 0xe0) {
+ // 3 bytes
+ const byte2 = src[position$1++] & 0x3f;
+ const byte3 = src[position$1++] & 0x3f;
+ units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);
+ } else if ((byte1 & 0xf8) === 0xf0) {
+ // 4 bytes
+ const byte2 = src[position$1++] & 0x3f;
+ const byte3 = src[position$1++] & 0x3f;
+ const byte4 = src[position$1++] & 0x3f;
+ let unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;
+ if (unit > 0xffff) {
+ unit -= 0x10000;
+ units.push(((unit >>> 10) & 0x3ff) | 0xd800);
+ unit = 0xdc00 | (unit & 0x3ff);
+ }
+ units.push(unit);
+ } else {
+ units.push(byte1);
+ }
+
+ if (units.length >= 0x1000) {
+ result += fromCharCode.apply(String, units);
+ units.length = 0;
+ }
+ }
+
+ if (units.length > 0) {
+ result += fromCharCode.apply(String, units);
+ }
+
+ return result
+ }
+ let fromCharCode = String.fromCharCode;
+ function longStringInJS(length) {
+ let start = position$1;
+ let bytes = new Array(length);
+ for (let i = 0; i < length; i++) {
+ const byte = src[position$1++];
+ if ((byte & 0x80) > 0) {
+ position$1 = start;
+ return
+ }
+ bytes[i] = byte;
+ }
+ return fromCharCode.apply(String, bytes)
+ }
+ function shortStringInJS(length) {
+ if (length < 4) {
+ if (length < 2) {
+ if (length === 0)
+ return ''
+ else {
+ let a = src[position$1++];
+ if ((a & 0x80) > 1) {
+ position$1 -= 1;
+ return
+ }
+ return fromCharCode(a)
+ }
+ } else {
+ let a = src[position$1++];
+ let b = src[position$1++];
+ if ((a & 0x80) > 0 || (b & 0x80) > 0) {
+ position$1 -= 2;
+ return
+ }
+ if (length < 3)
+ return fromCharCode(a, b)
+ let c = src[position$1++];
+ if ((c & 0x80) > 0) {
+ position$1 -= 3;
+ return
+ }
+ return fromCharCode(a, b, c)
+ }
+ } else {
+ let a = src[position$1++];
+ let b = src[position$1++];
+ let c = src[position$1++];
+ let d = src[position$1++];
+ if ((a & 0x80) > 0 || (b & 0x80) > 0 || (c & 0x80) > 0 || (d & 0x80) > 0) {
+ position$1 -= 4;
+ return
+ }
+ if (length < 6) {
+ if (length === 4)
+ return fromCharCode(a, b, c, d)
+ else {
+ let e = src[position$1++];
+ if ((e & 0x80) > 0) {
+ position$1 -= 5;
+ return
+ }
+ return fromCharCode(a, b, c, d, e)
+ }
+ } else if (length < 8) {
+ let e = src[position$1++];
+ let f = src[position$1++];
+ if ((e & 0x80) > 0 || (f & 0x80) > 0) {
+ position$1 -= 6;
+ return
+ }
+ if (length < 7)
+ return fromCharCode(a, b, c, d, e, f)
+ let g = src[position$1++];
+ if ((g & 0x80) > 0) {
+ position$1 -= 7;
+ return
+ }
+ return fromCharCode(a, b, c, d, e, f, g)
+ } else {
+ let e = src[position$1++];
+ let f = src[position$1++];
+ let g = src[position$1++];
+ let h = src[position$1++];
+ if ((e & 0x80) > 0 || (f & 0x80) > 0 || (g & 0x80) > 0 || (h & 0x80) > 0) {
+ position$1 -= 8;
+ return
+ }
+ if (length < 10) {
+ if (length === 8)
+ return fromCharCode(a, b, c, d, e, f, g, h)
+ else {
+ let i = src[position$1++];
+ if ((i & 0x80) > 0) {
+ position$1 -= 9;
+ return
+ }
+ return fromCharCode(a, b, c, d, e, f, g, h, i)
+ }
+ } else if (length < 12) {
+ let i = src[position$1++];
+ let j = src[position$1++];
+ if ((i & 0x80) > 0 || (j & 0x80) > 0) {
+ position$1 -= 10;
+ return
+ }
+ if (length < 11)
+ return fromCharCode(a, b, c, d, e, f, g, h, i, j)
+ let k = src[position$1++];
+ if ((k & 0x80) > 0) {
+ position$1 -= 11;
+ return
+ }
+ return fromCharCode(a, b, c, d, e, f, g, h, i, j, k)
+ } else {
+ let i = src[position$1++];
+ let j = src[position$1++];
+ let k = src[position$1++];
+ let l = src[position$1++];
+ if ((i & 0x80) > 0 || (j & 0x80) > 0 || (k & 0x80) > 0 || (l & 0x80) > 0) {
+ position$1 -= 12;
+ return
+ }
+ if (length < 14) {
+ if (length === 12)
+ return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l)
+ else {
+ let m = src[position$1++];
+ if ((m & 0x80) > 0) {
+ position$1 -= 13;
+ return
+ }
+ return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m)
+ }
+ } else {
+ let m = src[position$1++];
+ let n = src[position$1++];
+ if ((m & 0x80) > 0 || (n & 0x80) > 0) {
+ position$1 -= 14;
+ return
+ }
+ if (length < 15)
+ return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n)
+ let o = src[position$1++];
+ if ((o & 0x80) > 0) {
+ position$1 -= 15;
+ return
+ }
+ return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
+ }
+ }
+ }
+ }
+ }
+
+ function readBin(length) {
+ return currentDecoder.copyBuffers ?
+ // specifically use the copying slice (not the node one)
+ Uint8Array.prototype.slice.call(src, position$1, position$1 += length) :
+ src.subarray(position$1, position$1 += length)
+ }
+ let f32Array = new Float32Array(1);
+ let u8Array = new Uint8Array(f32Array.buffer, 0, 4);
+ function getFloat16() {
+ let byte0 = src[position$1++];
+ let byte1 = src[position$1++];
+ let exponent = (byte0 & 0x7f) >> 2;
+ if (exponent === 0x1f) { // specials
+ if (byte1 || (byte0 & 3))
+ return NaN;
+ return (byte0 & 0x80) ? -Infinity : Infinity;
+ }
+ if (exponent === 0) { // sub-normals
+ // significand with 10 fractional bits and divided by 2^14
+ let abs = (((byte0 & 3) << 8) | byte1) / (1 << 24);
+ return (byte0 & 0x80) ? -abs : abs
+ }
+
+ u8Array[3] = (byte0 & 0x80) | // sign bit
+ ((exponent >> 1) + 56); // 4 of 5 of the exponent bits, re-offset-ed
+ u8Array[2] = ((byte0 & 7) << 5) | // last exponent bit and first two mantissa bits
+ (byte1 >> 3); // next 5 bits of mantissa
+ u8Array[1] = byte1 << 5; // last three bits of mantissa
+ u8Array[0] = 0;
+ return f32Array[0];
+ }
+
+ new Array(4096);
+
+ class Tag {
+ constructor(value, tag) {
+ this.value = value;
+ this.tag = tag;
+ }
+ }
+
+ currentExtensions[0] = (dateString) => {
+ // string date extension
+ return new Date(dateString)
+ };
+
+ currentExtensions[1] = (epochSec) => {
+ // numeric date extension
+ return new Date(Math.round(epochSec * 1000))
+ };
+
+ currentExtensions[2] = (buffer) => {
+ // bigint extension
+ let value = BigInt(0);
+ for (let i = 0, l = buffer.byteLength; i < l; i++) {
+ value = BigInt(buffer[i]) + value << BigInt(8);
+ }
+ return value
+ };
+
+ currentExtensions[3] = (buffer) => {
+ // negative bigint extension
+ return BigInt(-1) - currentExtensions[2](buffer)
+ };
+ currentExtensions[4] = (fraction) => {
+ // best to reparse to maintain accuracy
+ return +(fraction[1] + 'e' + fraction[0])
+ };
+
+ currentExtensions[5] = (fraction) => {
+ // probably not sufficiently accurate
+ return fraction[1] * Math.exp(fraction[0] * Math.log(2))
+ };
- function asciiToBytes (str) {
- var byteArray = [];
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF);
- }
- return byteArray
+ // the registration of the record definition extension
+ const recordDefinition = (id, structure) => {
+ id = id - 0xe000;
+ let existingStructure = currentStructures[id];
+ if (existingStructure && existingStructure.isShared) {
+ (currentStructures.restoreStructures || (currentStructures.restoreStructures = []))[id] = existingStructure;
+ }
+ currentStructures[id] = structure;
+
+ structure.read = createStructureReader(structure);
+ };
+ currentExtensions[LEGACY_RECORD_INLINE_ID] = (data) => {
+ let length = data.length;
+ let structure = data[1];
+ recordDefinition(data[0], structure);
+ let object = {};
+ for (let i = 2; i < length; i++) {
+ let key = structure[i - 2];
+ object[safeKey(key)] = data[i];
+ }
+ return object
+ };
+ currentExtensions[14] = (value) => {
+ if (bundledStrings$1)
+ return bundledStrings$1[0].slice(bundledStrings$1.position0, bundledStrings$1.position0 += value)
+ return new Tag(value, 14)
+ };
+ currentExtensions[15] = (value) => {
+ if (bundledStrings$1)
+ return bundledStrings$1[1].slice(bundledStrings$1.position1, bundledStrings$1.position1 += value)
+ return new Tag(value, 15)
+ };
+ let glbl = { Error, RegExp };
+ currentExtensions[27] = (data) => { // http://cbor.schmorp.de/generic-object
+ return (glbl[data[0]] || Error)(data[1], data[2])
+ };
+ const packedTable = (read) => {
+ if (src[position$1++] != 0x84)
+ throw new Error('Packed values structure must be followed by a 4 element array')
+ let newPackedValues = read(); // packed values
+ packedValues = packedValues ? newPackedValues.concat(packedValues.slice(newPackedValues.length)) : newPackedValues;
+ packedValues.prefixes = read();
+ packedValues.suffixes = read();
+ return read() // read the rump
+ };
+ packedTable.handlesRead = true;
+ currentExtensions[51] = packedTable;
+
+ currentExtensions[PACKED_REFERENCE_TAG_ID] = (data) => { // packed reference
+ if (!packedValues) {
+ if (currentDecoder.getShared)
+ loadShared();
+ else
+ return new Tag(data, PACKED_REFERENCE_TAG_ID)
+ }
+ if (typeof data == 'number')
+ return packedValues[16 + (data >= 0 ? 2 * data : (-2 * data - 1))]
+ throw new Error('No support for non-integer packed references yet')
+ };
+
+ // The following code is an incomplete implementation of http://cbor.schmorp.de/stringref
+ // the real thing would need to implemennt more logic to populate the stringRefs table and
+ // maintain a stack of stringRef "namespaces".
+ //
+ // currentExtensions[25] = (id) => {
+ // return stringRefs[id]
+ // }
+ // currentExtensions[256] = (read) => {
+ // stringRefs = []
+ // try {
+ // return read()
+ // } finally {
+ // stringRefs = null
+ // }
+ // }
+ // currentExtensions[256].handlesRead = true
+
+ currentExtensions[28] = (read) => {
+ // shareable http://cbor.schmorp.de/value-sharing (for structured clones)
+ if (!referenceMap) {
+ referenceMap = new Map();
+ referenceMap.id = 0;
+ }
+ let id = referenceMap.id++;
+ let token = src[position$1];
+ let target;
+ // TODO: handle Maps, Sets, and other types that can cycle; this is complicated, because you potentially need to read
+ // ahead past references to record structure definitions
+ if ((token >> 5) == 4)
+ target = [];
+ else
+ target = {};
+
+ let refEntry = { target }; // a placeholder object
+ referenceMap.set(id, refEntry);
+ let targetProperties = read(); // read the next value as the target object to id
+ if (refEntry.used) // there is a cycle, so we have to assign properties to original target
+ return Object.assign(target, targetProperties)
+ refEntry.target = targetProperties; // the placeholder wasn't used, replace with the deserialized one
+ return targetProperties // no cycle, can just use the returned read object
+ };
+ currentExtensions[28].handlesRead = true;
+
+ currentExtensions[29] = (id) => {
+ // sharedref http://cbor.schmorp.de/value-sharing (for structured clones)
+ let refEntry = referenceMap.get(id);
+ refEntry.used = true;
+ return refEntry.target
+ };
+
+ currentExtensions[258] = (array) => new Set(array); // https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md
+ (currentExtensions[259] = (read) => {
+ // https://github.com/shanewholloway/js-cbor-codec/blob/master/docs/CBOR-259-spec
+ // for decoding as a standard Map
+ if (currentDecoder.mapsAsObjects) {
+ currentDecoder.mapsAsObjects = false;
+ restoreMapsAsObject = true;
+ }
+ return read()
+ }).handlesRead = true;
+ function combine(a, b) {
+ if (typeof a === 'string')
+ return a + b
+ if (a instanceof Array)
+ return a.concat(b)
+ return Object.assign({}, a, b)
}
+ function getPackedValues() {
+ if (!packedValues) {
+ if (currentDecoder.getShared)
+ loadShared();
+ else
+ throw new Error('No packed values available')
+ }
+ return packedValues
+ }
+ const SHARED_DATA_TAG_ID = 0x53687264; // ascii 'Shrd'
+ currentExtensionRanges.push((tag, input) => {
+ if (tag >= 225 && tag <= 255)
+ return combine(getPackedValues().prefixes[tag - 224], input)
+ if (tag >= 28704 && tag <= 32767)
+ return combine(getPackedValues().prefixes[tag - 28672], input)
+ if (tag >= 1879052288 && tag <= 2147483647)
+ return combine(getPackedValues().prefixes[tag - 1879048192], input)
+ if (tag >= 216 && tag <= 223)
+ return combine(input, getPackedValues().suffixes[tag - 216])
+ if (tag >= 27647 && tag <= 28671)
+ return combine(input, getPackedValues().suffixes[tag - 27639])
+ if (tag >= 1811940352 && tag <= 1879048191)
+ return combine(input, getPackedValues().suffixes[tag - 1811939328])
+ if (tag == SHARED_DATA_TAG_ID) {// we do a special check for this so that we can keep the currentExtensions as densely stored array (v8 stores arrays densely under about 3000 elements)
+ return {
+ packedValues: packedValues,
+ structures: currentStructures.slice(0),
+ version: input,
+ }
+ }
+ if (tag == 55799) // self-descriptive CBOR tag, just return input value
+ return input
+ });
- function utf16leToBytes (str, units) {
- var c, hi, lo;
- var byteArray = [];
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
+ const isLittleEndianMachine$1 = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1;
+ const typedArrays = [Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array,
+ typeof BigUint64Array == 'undefined' ? { name:'BigUint64Array' } : BigUint64Array, Int8Array, Int16Array, Int32Array,
+ typeof BigInt64Array == 'undefined' ? { name:'BigInt64Array' } : BigInt64Array, Float32Array, Float64Array];
+ const typedArrayTags = [64, 68, 69, 70, 71, 72, 77, 78, 79, 85, 86];
+ for (let i = 0; i < typedArrays.length; i++) {
+ registerTypedArray(typedArrays[i], typedArrayTags[i]);
+ }
+ function registerTypedArray(TypedArray, tag) {
+ let dvMethod = 'get' + TypedArray.name.slice(0, -5);
+ let bytesPerElement;
+ if (typeof TypedArray === 'function')
+ bytesPerElement = TypedArray.BYTES_PER_ELEMENT;
+ else
+ TypedArray = null;
+ for (let littleEndian = 0; littleEndian < 2; littleEndian++) {
+ if (!littleEndian && bytesPerElement == 1)
+ continue
+ let sizeShift = bytesPerElement == 2 ? 1 : bytesPerElement == 4 ? 2 : 3;
+ currentExtensions[littleEndian ? tag : (tag - 4)] = (bytesPerElement == 1 || littleEndian == isLittleEndianMachine$1) ? (buffer) => {
+ if (!TypedArray)
+ throw new Error('Could not find typed array for code ' + tag)
+ // we have to always slice/copy here to get a new ArrayBuffer that is word/byte aligned
+ return new TypedArray(Uint8Array.prototype.slice.call(buffer, 0).buffer)
+ } : buffer => {
+ if (!TypedArray)
+ throw new Error('Could not find typed array for code ' + tag)
+ let dv = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
+ let elements = buffer.length >> sizeShift;
+ let ta = new TypedArray(elements);
+ let method = dv[dvMethod];
+ for (let i = 0; i < elements; i++) {
+ ta[i] = method.call(dv, i << sizeShift, littleEndian);
+ }
+ return ta
+ };
+ }
+ }
- c = str.charCodeAt(i);
- hi = c >> 8;
- lo = c % 256;
- byteArray.push(lo);
- byteArray.push(hi);
- }
+ function readBundleExt() {
+ let length = readJustLength();
+ let bundlePosition = position$1 + read();
+ for (let i = 2; i < length; i++) {
+ // skip past bundles that were already read
+ let bundleLength = readJustLength(); // this will increment position, so must add to position afterwards
+ position$1 += bundleLength;
+ }
+ let dataPosition = position$1;
+ position$1 = bundlePosition;
+ bundledStrings$1 = [readStringJS(readJustLength()), readStringJS(readJustLength())];
+ bundledStrings$1.position0 = 0;
+ bundledStrings$1.position1 = 0;
+ bundledStrings$1.postBundlePosition = position$1;
+ position$1 = dataPosition;
+ return read()
+ }
- return byteArray
+ function readJustLength() {
+ let token = src[position$1++] & 0x1f;
+ if (token > 0x17) {
+ switch (token) {
+ case 0x18:
+ token = src[position$1++];
+ break
+ case 0x19:
+ token = dataView.getUint16(position$1);
+ position$1 += 2;
+ break
+ case 0x1a:
+ token = dataView.getUint32(position$1);
+ position$1 += 4;
+ break
+ }
+ }
+ return token
}
+ function loadShared() {
+ if (currentDecoder.getShared) {
+ let sharedData = saveState(() => {
+ // save the state in case getShared modifies our buffer
+ src = null;
+ return currentDecoder.getShared()
+ }) || {};
+ let updatedStructures = sharedData.structures || [];
+ currentDecoder.sharedVersion = sharedData.version;
+ packedValues = currentDecoder.sharedValues = sharedData.packedValues;
+ if (currentStructures === true)
+ currentDecoder.structures = currentStructures = updatedStructures;
+ else
+ currentStructures.splice.apply(currentStructures, [0, updatedStructures.length].concat(updatedStructures));
+ }
+ }
- function base64ToBytes (str) {
- return toByteArray(base64clean(str))
+ function saveState(callback) {
+ let savedSrcEnd = srcEnd;
+ let savedPosition = position$1;
+ let savedSrcStringStart = srcStringStart;
+ let savedSrcStringEnd = srcStringEnd;
+ let savedSrcString = srcString;
+ let savedReferenceMap = referenceMap;
+ let savedBundledStrings = bundledStrings$1;
+
+ // TODO: We may need to revisit this if we do more external calls to user code (since it could be slow)
+ let savedSrc = new Uint8Array(src.slice(0, srcEnd)); // we copy the data in case it changes while external data is processed
+ let savedStructures = currentStructures;
+ let savedDecoder = currentDecoder;
+ let savedSequentialMode = sequentialMode;
+ let value = callback();
+ srcEnd = savedSrcEnd;
+ position$1 = savedPosition;
+ srcStringStart = savedSrcStringStart;
+ srcStringEnd = savedSrcStringEnd;
+ srcString = savedSrcString;
+ referenceMap = savedReferenceMap;
+ bundledStrings$1 = savedBundledStrings;
+ src = savedSrc;
+ sequentialMode = savedSequentialMode;
+ currentStructures = savedStructures;
+ currentDecoder = savedDecoder;
+ dataView = new DataView(src.buffer, src.byteOffset, src.byteLength);
+ return value
+ }
+ function clearSource() {
+ src = null;
+ referenceMap = null;
+ currentStructures = null;
}
- function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i];
- }
- return i
+ function addExtension$1(extension) {
+ currentExtensions[extension.tag] = extension.decode;
}
- function isnan (val) {
- return val !== val // eslint-disable-line no-self-compare
+ const mult10 = new Array(147); // this is a table matching binary exponents to the multiplier to determine significant digit rounding
+ for (let i = 0; i < 256; i++) {
+ mult10[i] = +('1e' + Math.floor(45.15 - i * 0.30103));
}
+ let defaultDecoder = new Decoder({ useRecords: false });
+ defaultDecoder.decode;
+ defaultDecoder.decodeMultiple;
+ let textEncoder;
+ try {
+ textEncoder = new TextEncoder();
+ } catch (error) {}
+ let extensions, extensionClasses;
+ const Buffer = typeof globalThis === 'object' && globalThis.Buffer;
+ const hasNodeBuffer = typeof Buffer !== 'undefined';
+ const ByteArrayAllocate = hasNodeBuffer ? Buffer.allocUnsafeSlow : Uint8Array;
+ const ByteArray = hasNodeBuffer ? Buffer : Uint8Array;
+ const MAX_STRUCTURES = 0x100;
+ const MAX_BUFFER_SIZE = hasNodeBuffer ? 0x100000000 : 0x7fd00000;
+ let throwOnIterable;
+ let target;
+ let targetView;
+ let position = 0;
+ let safeEnd;
+ let bundledStrings = null;
+ const MAX_BUNDLE_SIZE = 0xf000;
+ const hasNonLatin = /[\u0080-\uFFFF]/;
+ const RECORD_SYMBOL = Symbol('record-id');
+ class Encoder extends Decoder {
+ constructor(options) {
+ super(options);
+ this.offset = 0;
+ let start;
+ let sharedStructures;
+ let hasSharedUpdate;
+ let structures;
+ let referenceMap;
+ options = options || {};
+ let encodeUtf8 = ByteArray.prototype.utf8Write ? function(string, position, maxBytes) {
+ return target.utf8Write(string, position, maxBytes)
+ } : (textEncoder && textEncoder.encodeInto) ?
+ function(string, position) {
+ return textEncoder.encodeInto(string, target.subarray(position)).written
+ } : false;
+
+ let encoder = this;
+ let hasSharedStructures = options.structures || options.saveStructures;
+ let maxSharedStructures = options.maxSharedStructures;
+ if (maxSharedStructures == null)
+ maxSharedStructures = hasSharedStructures ? 128 : 0;
+ if (maxSharedStructures > 8190)
+ throw new Error('Maximum maxSharedStructure is 8190')
+ let isSequential = options.sequential;
+ if (isSequential) {
+ maxSharedStructures = 0;
+ }
+ if (!this.structures)
+ this.structures = [];
+ if (this.saveStructures)
+ this.saveShared = this.saveStructures;
+ let samplingPackedValues, packedObjectMap, sharedValues = options.sharedValues;
+ let sharedPackedObjectMap;
+ if (sharedValues) {
+ sharedPackedObjectMap = Object.create(null);
+ for (let i = 0, l = sharedValues.length; i < l; i++) {
+ sharedPackedObjectMap[sharedValues[i]] = i;
+ }
+ }
+ let recordIdsToRemove = [];
+ let transitionsCount = 0;
+ let serializationsSinceTransitionRebuild = 0;
+
+ this.mapEncode = function(value, encodeOptions) {
+ // Experimental support for premapping keys using _keyMap instad of keyMap - not optiimised yet)
+ if (this._keyMap && !this._mapped) {
+ //console.log('encoding ', value)
+ switch (value.constructor.name) {
+ case 'Array':
+ value = value.map(r => this.encodeKeys(r));
+ break
+ //case 'Map':
+ // value = this.encodeKeys(value)
+ // break
+ }
+ //this._mapped = true
+ }
+ return this.encode(value, encodeOptions)
+ };
+
+ this.encode = function(value, encodeOptions) {
+ if (!target) {
+ target = new ByteArrayAllocate(8192);
+ targetView = new DataView(target.buffer, 0, 8192);
+ position = 0;
+ }
+ safeEnd = target.length - 10;
+ if (safeEnd - position < 0x800) {
+ // don't start too close to the end,
+ target = new ByteArrayAllocate(target.length);
+ targetView = new DataView(target.buffer, 0, target.length);
+ safeEnd = target.length - 10;
+ position = 0;
+ } else if (encodeOptions === REUSE_BUFFER_MODE)
+ position = (position + 7) & 0x7ffffff8; // Word align to make any future copying of this buffer faster
+ start = position;
+ if (encoder.useSelfDescribedHeader) {
+ targetView.setUint32(position, 0xd9d9f700); // tag two byte, then self-descriptive tag
+ position += 3;
+ }
+ referenceMap = encoder.structuredClone ? new Map() : null;
+ if (encoder.bundleStrings && typeof value !== 'string') {
+ bundledStrings = [];
+ bundledStrings.size = Infinity; // force a new bundle start on first string
+ } else
+ bundledStrings = null;
+
+ sharedStructures = encoder.structures;
+ if (sharedStructures) {
+ if (sharedStructures.uninitialized) {
+ let sharedData = encoder.getShared() || {};
+ encoder.structures = sharedStructures = sharedData.structures || [];
+ encoder.sharedVersion = sharedData.version;
+ let sharedValues = encoder.sharedValues = sharedData.packedValues;
+ if (sharedValues) {
+ sharedPackedObjectMap = {};
+ for (let i = 0, l = sharedValues.length; i < l; i++)
+ sharedPackedObjectMap[sharedValues[i]] = i;
+ }
+ }
+ let sharedStructuresLength = sharedStructures.length;
+ if (sharedStructuresLength > maxSharedStructures && !isSequential)
+ sharedStructuresLength = maxSharedStructures;
+ if (!sharedStructures.transitions) {
+ // rebuild our structure transitions
+ sharedStructures.transitions = Object.create(null);
+ for (let i = 0; i < sharedStructuresLength; i++) {
+ let keys = sharedStructures[i];
+ //console.log('shared struct keys:', keys)
+ if (!keys)
+ continue
+ let nextTransition, transition = sharedStructures.transitions;
+ for (let j = 0, l = keys.length; j < l; j++) {
+ if (transition[RECORD_SYMBOL] === undefined)
+ transition[RECORD_SYMBOL] = i;
+ let key = keys[j];
+ nextTransition = transition[key];
+ if (!nextTransition) {
+ nextTransition = transition[key] = Object.create(null);
+ }
+ transition = nextTransition;
+ }
+ transition[RECORD_SYMBOL] = i | 0x100000;
+ }
+ }
+ if (!isSequential)
+ sharedStructures.nextId = sharedStructuresLength;
+ }
+ if (hasSharedUpdate)
+ hasSharedUpdate = false;
+ structures = sharedStructures || [];
+ packedObjectMap = sharedPackedObjectMap;
+ if (options.pack) {
+ let packedValues = new Map();
+ packedValues.values = [];
+ packedValues.encoder = encoder;
+ packedValues.maxValues = options.maxPrivatePackedValues || (sharedPackedObjectMap ? 16 : Infinity);
+ packedValues.objectMap = sharedPackedObjectMap || false;
+ packedValues.samplingPackedValues = samplingPackedValues;
+ findRepetitiveStrings(value, packedValues);
+ if (packedValues.values.length > 0) {
+ target[position++] = 0xd8; // one-byte tag
+ target[position++] = 51; // tag 51 for packed shared structures https://www.potaroo.net/ietf/ids/draft-ietf-cbor-packed-03.txt
+ writeArrayHeader(4);
+ let valuesArray = packedValues.values;
+ encode(valuesArray);
+ writeArrayHeader(0); // prefixes
+ writeArrayHeader(0); // suffixes
+ packedObjectMap = Object.create(sharedPackedObjectMap || null);
+ for (let i = 0, l = valuesArray.length; i < l; i++) {
+ packedObjectMap[valuesArray[i]] = i;
+ }
+ }
+ }
+ throwOnIterable = encodeOptions & THROW_ON_ITERABLE;
+ try {
+ if (throwOnIterable)
+ return;
+ encode(value);
+ if (bundledStrings) {
+ writeBundles(start, encode);
+ }
+ encoder.offset = position; // update the offset so next serialization doesn't write over our buffer, but can continue writing to same buffer sequentially
+ if (referenceMap && referenceMap.idsToInsert) {
+ position += referenceMap.idsToInsert.length * 2;
+ if (position > safeEnd)
+ makeRoom(position);
+ encoder.offset = position;
+ let serialized = insertIds(target.subarray(start, position), referenceMap.idsToInsert);
+ referenceMap = null;
+ return serialized
+ }
+ if (encodeOptions & REUSE_BUFFER_MODE) {
+ target.start = start;
+ target.end = position;
+ return target
+ }
+ return target.subarray(start, position) // position can change if we call encode again in saveShared, so we get the buffer now
+ } finally {
+ if (sharedStructures) {
+ if (serializationsSinceTransitionRebuild < 10)
+ serializationsSinceTransitionRebuild++;
+ if (sharedStructures.length > maxSharedStructures)
+ sharedStructures.length = maxSharedStructures;
+ if (transitionsCount > 10000) {
+ // force a rebuild occasionally after a lot of transitions so it can get cleaned up
+ sharedStructures.transitions = null;
+ serializationsSinceTransitionRebuild = 0;
+ transitionsCount = 0;
+ if (recordIdsToRemove.length > 0)
+ recordIdsToRemove = [];
+ } else if (recordIdsToRemove.length > 0 && !isSequential) {
+ for (let i = 0, l = recordIdsToRemove.length; i < l; i++) {
+ recordIdsToRemove[i][RECORD_SYMBOL] = undefined;
+ }
+ recordIdsToRemove = [];
+ //sharedStructures.nextId = maxSharedStructures
+ }
+ }
+ if (hasSharedUpdate && encoder.saveShared) {
+ if (encoder.structures.length > maxSharedStructures) {
+ encoder.structures = encoder.structures.slice(0, maxSharedStructures);
+ }
+ // we can't rely on start/end with REUSE_BUFFER_MODE since they will (probably) change when we save
+ let returnBuffer = target.subarray(start, position);
+ if (encoder.updateSharedData() === false)
+ return encoder.encode(value) // re-encode if it fails
+ return returnBuffer
+ }
+ if (encodeOptions & RESET_BUFFER_MODE)
+ position = start;
+ }
+ };
+ this.findCommonStringsToPack = () => {
+ samplingPackedValues = new Map();
+ if (!sharedPackedObjectMap)
+ sharedPackedObjectMap = Object.create(null);
+ return (options) => {
+ let threshold = options && options.threshold || 4;
+ let position = this.pack ? options.maxPrivatePackedValues || 16 : 0;
+ if (!sharedValues)
+ sharedValues = this.sharedValues = [];
+ for (let [ key, status ] of samplingPackedValues) {
+ if (status.count > threshold) {
+ sharedPackedObjectMap[key] = position++;
+ sharedValues.push(key);
+ hasSharedUpdate = true;
+ }
+ }
+ while (this.saveShared && this.updateSharedData() === false) {}
+ samplingPackedValues = null;
+ }
+ };
+ const encode = (value) => {
+ if (position > safeEnd)
+ target = makeRoom(position);
+
+ var type = typeof value;
+ var length;
+ if (type === 'string') {
+ if (packedObjectMap) {
+ let packedPosition = packedObjectMap[value];
+ if (packedPosition >= 0) {
+ if (packedPosition < 16)
+ target[position++] = packedPosition + 0xe0; // simple values, defined in https://www.potaroo.net/ietf/ids/draft-ietf-cbor-packed-03.txt
+ else {
+ target[position++] = 0xc6; // tag 6 defined in https://www.potaroo.net/ietf/ids/draft-ietf-cbor-packed-03.txt
+ if (packedPosition & 1)
+ encode((15 - packedPosition) >> 1);
+ else
+ encode((packedPosition - 16) >> 1);
+ }
+ return
+ /* } else if (packedStatus.serializationId != serializationId) {
+ packedStatus.serializationId = serializationId
+ packedStatus.count = 1
+ if (options.sharedPack) {
+ let sharedCount = packedStatus.sharedCount = (packedStatus.sharedCount || 0) + 1
+ if (shareCount > (options.sharedPack.threshold || 5)) {
+ let sharedPosition = packedStatus.position = packedStatus.nextSharedPosition
+ hasSharedUpdate = true
+ if (sharedPosition < 16)
+ target[position++] = sharedPosition + 0xc0
+
+ }
+ }
+ } // else any in-doc incrementation?*/
+ } else if (samplingPackedValues && !options.pack) {
+ let status = samplingPackedValues.get(value);
+ if (status)
+ status.count++;
+ else
+ samplingPackedValues.set(value, {
+ count: 1,
+ });
+ }
+ }
+ let strLength = value.length;
+ if (bundledStrings && strLength >= 4 && strLength < 0x400) {
+ if ((bundledStrings.size += strLength) > MAX_BUNDLE_SIZE) {
+ let extStart;
+ let maxBytes = (bundledStrings[0] ? bundledStrings[0].length * 3 + bundledStrings[1].length : 0) + 10;
+ if (position + maxBytes > safeEnd)
+ target = makeRoom(position + maxBytes);
+ target[position++] = 0xd9; // tag 16-bit
+ target[position++] = 0xdf; // tag 0xdff9
+ target[position++] = 0xf9;
+ // TODO: If we only have one bundle with any string data, only write one string bundle
+ target[position++] = bundledStrings.position ? 0x84 : 0x82; // array of 4 or 2 elements depending on if we write bundles
+ target[position++] = 0x1a; // 32-bit unsigned int
+ extStart = position - start;
+ position += 4; // reserve for writing bundle reference
+ if (bundledStrings.position) {
+ writeBundles(start, encode); // write the last bundles
+ }
+ bundledStrings = ['', '']; // create new ones
+ bundledStrings.size = 0;
+ bundledStrings.position = extStart;
+ }
+ let twoByte = hasNonLatin.test(value);
+ bundledStrings[twoByte ? 0 : 1] += value;
+ target[position++] = twoByte ? 0xce : 0xcf;
+ encode(strLength);
+ return
+ }
+ let headerSize;
+ // first we estimate the header size, so we can write to the correct location
+ if (strLength < 0x20) {
+ headerSize = 1;
+ } else if (strLength < 0x100) {
+ headerSize = 2;
+ } else if (strLength < 0x10000) {
+ headerSize = 3;
+ } else {
+ headerSize = 5;
+ }
+ let maxBytes = strLength * 3;
+ if (position + maxBytes > safeEnd)
+ target = makeRoom(position + maxBytes);
+
+ if (strLength < 0x40 || !encodeUtf8) {
+ let i, c1, c2, strPosition = position + headerSize;
+ for (i = 0; i < strLength; i++) {
+ c1 = value.charCodeAt(i);
+ if (c1 < 0x80) {
+ target[strPosition++] = c1;
+ } else if (c1 < 0x800) {
+ target[strPosition++] = c1 >> 6 | 0xc0;
+ target[strPosition++] = c1 & 0x3f | 0x80;
+ } else if (
+ (c1 & 0xfc00) === 0xd800 &&
+ ((c2 = value.charCodeAt(i + 1)) & 0xfc00) === 0xdc00
+ ) {
+ c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff);
+ i++;
+ target[strPosition++] = c1 >> 18 | 0xf0;
+ target[strPosition++] = c1 >> 12 & 0x3f | 0x80;
+ target[strPosition++] = c1 >> 6 & 0x3f | 0x80;
+ target[strPosition++] = c1 & 0x3f | 0x80;
+ } else {
+ target[strPosition++] = c1 >> 12 | 0xe0;
+ target[strPosition++] = c1 >> 6 & 0x3f | 0x80;
+ target[strPosition++] = c1 & 0x3f | 0x80;
+ }
+ }
+ length = strPosition - position - headerSize;
+ } else {
+ length = encodeUtf8(value, position + headerSize, maxBytes);
+ }
+
+ if (length < 0x18) {
+ target[position++] = 0x60 | length;
+ } else if (length < 0x100) {
+ if (headerSize < 2) {
+ target.copyWithin(position + 2, position + 1, position + 1 + length);
+ }
+ target[position++] = 0x78;
+ target[position++] = length;
+ } else if (length < 0x10000) {
+ if (headerSize < 3) {
+ target.copyWithin(position + 3, position + 2, position + 2 + length);
+ }
+ target[position++] = 0x79;
+ target[position++] = length >> 8;
+ target[position++] = length & 0xff;
+ } else {
+ if (headerSize < 5) {
+ target.copyWithin(position + 5, position + 3, position + 3 + length);
+ }
+ target[position++] = 0x7a;
+ targetView.setUint32(position, length);
+ position += 4;
+ }
+ position += length;
+ } else if (type === 'number') {
+ if (!this.alwaysUseFloat && value >>> 0 === value) {// positive integer, 32-bit or less
+ // positive uint
+ if (value < 0x18) {
+ target[position++] = value;
+ } else if (value < 0x100) {
+ target[position++] = 0x18;
+ target[position++] = value;
+ } else if (value < 0x10000) {
+ target[position++] = 0x19;
+ target[position++] = value >> 8;
+ target[position++] = value & 0xff;
+ } else {
+ target[position++] = 0x1a;
+ targetView.setUint32(position, value);
+ position += 4;
+ }
+ } else if (!this.alwaysUseFloat && value >> 0 === value) { // negative integer
+ if (value >= -0x18) {
+ target[position++] = 0x1f - value;
+ } else if (value >= -0x100) {
+ target[position++] = 0x38;
+ target[position++] = ~value;
+ } else if (value >= -0x10000) {
+ target[position++] = 0x39;
+ targetView.setUint16(position, ~value);
+ position += 2;
+ } else {
+ target[position++] = 0x3a;
+ targetView.setUint32(position, ~value);
+ position += 4;
+ }
+ } else {
+ let useFloat32;
+ if ((useFloat32 = this.useFloat32) > 0 && value < 0x100000000 && value >= -0x80000000) {
+ target[position++] = 0xfa;
+ targetView.setFloat32(position, value);
+ let xShifted;
+ if (useFloat32 < 4 ||
+ // this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
+ ((xShifted = value * mult10[((target[position] & 0x7f) << 1) | (target[position + 1] >> 7)]) >> 0) === xShifted) {
+ position += 4;
+ return
+ } else
+ position--; // move back into position for writing a double
+ }
+ target[position++] = 0xfb;
+ targetView.setFloat64(position, value);
+ position += 8;
+ }
+ } else if (type === 'object') {
+ if (!value)
+ target[position++] = 0xf6;
+ else {
+ if (referenceMap) {
+ let referee = referenceMap.get(value);
+ if (referee) {
+ target[position++] = 0xd8;
+ target[position++] = 29; // http://cbor.schmorp.de/value-sharing
+ target[position++] = 0x19; // 16-bit uint
+ if (!referee.references) {
+ let idsToInsert = referenceMap.idsToInsert || (referenceMap.idsToInsert = []);
+ referee.references = [];
+ idsToInsert.push(referee);
+ }
+ referee.references.push(position - start);
+ position += 2; // TODO: also support 32-bit
+ return
+ } else
+ referenceMap.set(value, { offset: position - start });
+ }
+ let constructor = value.constructor;
+ if (constructor === Object) {
+ writeObject(value, true);
+ } else if (constructor === Array) {
+ length = value.length;
+ if (length < 0x18) {
+ target[position++] = 0x80 | length;
+ } else {
+ writeArrayHeader(length);
+ }
+ for (let i = 0; i < length; i++) {
+ encode(value[i]);
+ }
+ } else if (constructor === Map) {
+ if (this.mapsAsObjects ? this.useTag259ForMaps !== false : this.useTag259ForMaps) {
+ // use Tag 259 (https://github.com/shanewholloway/js-cbor-codec/blob/master/docs/CBOR-259-spec--explicit-maps.md) for maps if the user wants it that way
+ target[position++] = 0xd9;
+ target[position++] = 1;
+ target[position++] = 3;
+ }
+ length = value.size;
+ if (length < 0x18) {
+ target[position++] = 0xa0 | length;
+ } else if (length < 0x100) {
+ target[position++] = 0xb8;
+ target[position++] = length;
+ } else if (length < 0x10000) {
+ target[position++] = 0xb9;
+ target[position++] = length >> 8;
+ target[position++] = length & 0xff;
+ } else {
+ target[position++] = 0xba;
+ targetView.setUint32(position, length);
+ position += 4;
+ }
+ if (encoder.keyMap) {
+ for (let [ key, entryValue ] of value) {
+ encode(encoder.encodeKey(key));
+ encode(entryValue);
+ }
+ } else {
+ for (let [ key, entryValue ] of value) {
+ encode(key);
+ encode(entryValue);
+ }
+ }
+ } else {
+ for (let i = 0, l = extensions.length; i < l; i++) {
+ let extensionClass = extensionClasses[i];
+ if (value instanceof extensionClass) {
+ let extension = extensions[i];
+ let tag = extension.tag;
+ if (tag == undefined)
+ tag = extension.getTag && extension.getTag.call(this, value);
+ if (tag < 0x18) {
+ target[position++] = 0xc0 | tag;
+ } else if (tag < 0x100) {
+ target[position++] = 0xd8;
+ target[position++] = tag;
+ } else if (tag < 0x10000) {
+ target[position++] = 0xd9;
+ target[position++] = tag >> 8;
+ target[position++] = tag & 0xff;
+ } else if (tag > -1) {
+ target[position++] = 0xda;
+ targetView.setUint32(position, tag);
+ position += 4;
+ } // else undefined, don't write tag
+ extension.encode.call(this, value, encode, makeRoom);
+ return
+ }
+ }
+ if (value[Symbol.iterator]) {
+ if (throwOnIterable) {
+ let error = new Error('Iterable should be serialized as iterator');
+ error.iteratorNotHandled = true;
+ throw error;
+ }
+ target[position++] = 0x9f; // indefinite length array
+ for (let entry of value) {
+ encode(entry);
+ }
+ target[position++] = 0xff; // stop-code
+ return
+ }
+ if (value[Symbol.asyncIterator] || isBlob(value)) {
+ let error = new Error('Iterable/blob should be serialized as iterator');
+ error.iteratorNotHandled = true;
+ throw error;
+ }
+ if (this.useToJSON && value.toJSON) {
+ const json = value.toJSON();
+ // if for some reason value.toJSON returns itself it'll loop forever
+ if (json !== value)
+ return encode(json)
+ }
+
+ // no extension found, write as object
+ writeObject(value, !value.hasOwnProperty); // if it doesn't have hasOwnProperty, don't do hasOwnProperty checks
+ }
+ }
+ } else if (type === 'boolean') {
+ target[position++] = value ? 0xf5 : 0xf4;
+ } else if (type === 'bigint') {
+ if (value < (BigInt(1)<= 0) {
+ // use an unsigned int as long as it fits
+ target[position++] = 0x1b;
+ targetView.setBigUint64(position, value);
+ } else if (value > -(BigInt(1)< {
+ // this method is slightly slower, but generates "preferred serialization" (optimally small for smaller objects)
+ let keys = Object.keys(object);
+ let vals = Object.values(object);
+ let length = keys.length;
+ if (length < 0x18) {
+ target[position++] = 0xa0 | length;
+ } else if (length < 0x100) {
+ target[position++] = 0xb8;
+ target[position++] = length;
+ } else if (length < 0x10000) {
+ target[position++] = 0xb9;
+ target[position++] = length >> 8;
+ target[position++] = length & 0xff;
+ } else {
+ target[position++] = 0xba;
+ targetView.setUint32(position, length);
+ position += 4;
+ }
+ if (encoder.keyMap) {
+ for (let i = 0; i < length; i++) {
+ encode(encoder.encodeKey(keys[i]));
+ encode(vals[i]);
+ }
+ } else {
+ for (let i = 0; i < length; i++) {
+ encode(keys[i]);
+ encode(vals[i]);
+ }
+ }
+ } :
+ (object, safePrototype) => {
+ target[position++] = 0xb9; // always use map 16, so we can preallocate and set the length afterwards
+ let objectOffset = position - start;
+ position += 2;
+ let size = 0;
+ if (encoder.keyMap) {
+ for (let key in object) if (safePrototype || object.hasOwnProperty(key)) {
+ encode(encoder.encodeKey(key));
+ encode(object[key]);
+ size++;
+ }
+ } else {
+ for (let key in object) if (safePrototype || object.hasOwnProperty(key)) {
+ encode(key);
+ encode(object[key]);
+ size++;
+ }
+ }
+ target[objectOffset++ + start] = size >> 8;
+ target[objectOffset + start] = size & 0xff;
+ } :
+ (object, safePrototype) => {
+ let nextTransition, transition = structures.transitions || (structures.transitions = Object.create(null));
+ let newTransitions = 0;
+ let length = 0;
+ let parentRecordId;
+ let keys;
+ if (this.keyMap) {
+ keys = Object.keys(object).map(k => this.encodeKey(k));
+ length = keys.length;
+ for (let i = 0; i < length; i++) {
+ let key = keys[i];
+ nextTransition = transition[key];
+ if (!nextTransition) {
+ nextTransition = transition[key] = Object.create(null);
+ newTransitions++;
+ }
+ transition = nextTransition;
+ }
+ } else {
+ for (let key in object) if (safePrototype || object.hasOwnProperty(key)) {
+ nextTransition = transition[key];
+ if (!nextTransition) {
+ if (transition[RECORD_SYMBOL] & 0x100000) {// this indicates it is a brancheable/extendable terminal node, so we will use this record id and extend it
+ parentRecordId = transition[RECORD_SYMBOL] & 0xffff;
+ }
+ nextTransition = transition[key] = Object.create(null);
+ newTransitions++;
+ }
+ transition = nextTransition;
+ length++;
+ }
+ }
+ let recordId = transition[RECORD_SYMBOL];
+ if (recordId !== undefined) {
+ recordId &= 0xffff;
+ target[position++] = 0xd9;
+ target[position++] = (recordId >> 8) | 0xe0;
+ target[position++] = recordId & 0xff;
+ } else {
+ if (!keys)
+ keys = transition.__keys__ || (transition.__keys__ = Object.keys(object));
+ if (parentRecordId === undefined) {
+ recordId = structures.nextId++;
+ if (!recordId) {
+ recordId = 0;
+ structures.nextId = 1;
+ }
+ if (recordId >= MAX_STRUCTURES) {// cycle back around
+ structures.nextId = (recordId = maxSharedStructures) + 1;
+ }
+ } else {
+ recordId = parentRecordId;
+ }
+ structures[recordId] = keys;
+ if (recordId < maxSharedStructures) {
+ target[position++] = 0xd9;
+ target[position++] = (recordId >> 8) | 0xe0;
+ target[position++] = recordId & 0xff;
+ transition = structures.transitions;
+ for (let i = 0; i < length; i++) {
+ if (transition[RECORD_SYMBOL] === undefined || (transition[RECORD_SYMBOL] & 0x100000))
+ transition[RECORD_SYMBOL] = recordId;
+ transition = transition[keys[i]];
+ }
+ transition[RECORD_SYMBOL] = recordId | 0x100000; // indicates it is a extendable terminal
+ hasSharedUpdate = true;
+ } else {
+ transition[RECORD_SYMBOL] = recordId;
+ targetView.setUint32(position, 0xd9dfff00); // tag two byte, then record definition id
+ position += 3;
+ if (newTransitions)
+ transitionsCount += serializationsSinceTransitionRebuild * newTransitions;
+ // record the removal of the id, we can maintain our shared structure
+ if (recordIdsToRemove.length >= MAX_STRUCTURES - maxSharedStructures)
+ recordIdsToRemove.shift()[RECORD_SYMBOL] = undefined; // we are cycling back through, and have to remove old ones
+ recordIdsToRemove.push(transition);
+ writeArrayHeader(length + 2);
+ encode(0xe000 + recordId);
+ encode(keys);
+ if (safePrototype === null) return; // special exit for iterator
+ for (let key in object)
+ if (safePrototype || object.hasOwnProperty(key))
+ encode(object[key]);
+ return
+ }
+ }
+ if (length < 0x18) { // write the array header
+ target[position++] = 0x80 | length;
+ } else {
+ writeArrayHeader(length);
+ }
+ if (safePrototype === null) return; // special exit for iterator
+ for (let key in object)
+ if (safePrototype || object.hasOwnProperty(key))
+ encode(object[key]);
+ };
+ const makeRoom = (end) => {
+ let newSize;
+ if (end > 0x1000000) {
+ // special handling for really large buffers
+ if ((end - start) > MAX_BUFFER_SIZE)
+ throw new Error('Encoded buffer would be larger than maximum buffer size')
+ newSize = Math.min(MAX_BUFFER_SIZE,
+ Math.round(Math.max((end - start) * (end > 0x4000000 ? 1.25 : 2), 0x400000) / 0x1000) * 0x1000);
+ } else // faster handling for smaller buffers
+ newSize = ((Math.max((end - start) << 2, target.length - 1) >> 12) + 1) << 12;
+ let newBuffer = new ByteArrayAllocate(newSize);
+ targetView = new DataView(newBuffer.buffer, 0, newSize);
+ if (target.copy)
+ target.copy(newBuffer, 0, start, end);
+ else
+ newBuffer.set(target.slice(start, end));
+ position -= start;
+ start = 0;
+ safeEnd = newBuffer.length - 10;
+ return target = newBuffer
+ };
+ let chunkThreshold = 100;
+ let continuedChunkThreshold = 1000;
+ this.encodeAsIterable = function(value, options) {
+ return startEncoding(value, options, encodeObjectAsIterable);
+ };
+ this.encodeAsAsyncIterable = function(value, options) {
+ return startEncoding(value, options, encodeObjectAsAsyncIterable);
+ };
+
+ function* encodeObjectAsIterable(object, iterateProperties, finalIterable) {
+ let constructor = object.constructor;
+ if (constructor === Object) {
+ let useRecords = encoder.useRecords !== false;
+ if (useRecords)
+ writeObject(object, null); // write the record identifier
+ else
+ writeEntityLength(Object.keys(object).length, 0xa0);
+ for (let key in object) {
+ let value = object[key];
+ if (!useRecords) encode(key);
+ if (value && typeof value === 'object') {
+ if (iterateProperties[key])
+ yield* encodeObjectAsIterable(value, iterateProperties[key]);
+ else
+ yield* tryEncode(value, iterateProperties, key);
+ } else encode(value);
+ }
+ } else if (constructor === Array) {
+ let length = object.length;
+ writeArrayHeader(length);
+ for (let i = 0; i < length; i++) {
+ let value = object[i];
+ if (value && (typeof value === 'object' || position - start > chunkThreshold)) {
+ if (iterateProperties.element)
+ yield* encodeObjectAsIterable(value, iterateProperties.element);
+ else
+ yield* tryEncode(value, iterateProperties, 'element');
+ } else encode(value);
+ }
+ } else if (object[Symbol.iterator]) {
+ target[position++] = 0x9f; // start indefinite array
+ for (let value of object) {
+ if (value && (typeof value === 'object' || position - start > chunkThreshold)) {
+ if (iterateProperties.element)
+ yield* encodeObjectAsIterable(value, iterateProperties.element);
+ else
+ yield* tryEncode(value, iterateProperties, 'element');
+ } else encode(value);
+ }
+ target[position++] = 0xff; // stop byte
+ } else if (isBlob(object)){
+ writeEntityLength(object.size, 0x40); // encode as binary data
+ yield target.subarray(start, position);
+ yield object; // directly return blobs, they have to be encoded asynchronously
+ restartEncoding();
+ } else if (object[Symbol.asyncIterator]) {
+ target[position++] = 0x9f; // start indefinite array
+ yield target.subarray(start, position);
+ yield object; // directly return async iterators, they have to be encoded asynchronously
+ restartEncoding();
+ target[position++] = 0xff; // stop byte
+ } else {
+ encode(object);
+ }
+ if (finalIterable && position > start) yield target.subarray(start, position);
+ else if (position - start > chunkThreshold) {
+ yield target.subarray(start, position);
+ restartEncoding();
+ }
+ }
+ function* tryEncode(value, iterateProperties, key) {
+ let restart = position - start;
+ try {
+ encode(value);
+ if (position - start > chunkThreshold) {
+ yield target.subarray(start, position);
+ restartEncoding();
+ }
+ } catch (error) {
+ if (error.iteratorNotHandled) {
+ iterateProperties[key] = {};
+ position = start + restart; // restart our position so we don't have partial data from last encode
+ yield* encodeObjectAsIterable.call(this, value, iterateProperties[key]);
+ } else throw error;
+ }
+ }
+ function restartEncoding() {
+ chunkThreshold = continuedChunkThreshold;
+ encoder.encode(null, THROW_ON_ITERABLE); // restart encoding
+ }
+ function startEncoding(value, options, encodeIterable) {
+ if (options && options.chunkThreshold) // explicitly specified chunk sizes
+ chunkThreshold = continuedChunkThreshold = options.chunkThreshold;
+ else // we start with a smaller threshold to get initial bytes sent quickly
+ chunkThreshold = 100;
+ if (value && typeof value === 'object') {
+ encoder.encode(null, THROW_ON_ITERABLE); // start encoding
+ return encodeIterable(value, encoder.iterateProperties || (encoder.iterateProperties = {}), true);
+ }
+ return [encoder.encode(value)];
+ }
+
+ async function* encodeObjectAsAsyncIterable(value, iterateProperties) {
+ for (let encodedValue of encodeObjectAsIterable(value, iterateProperties, true)) {
+ let constructor = encodedValue.constructor;
+ if (constructor === ByteArray || constructor === Uint8Array)
+ yield encodedValue;
+ else if (isBlob(encodedValue)) {
+ let reader = encodedValue.stream().getReader();
+ let next;
+ while (!(next = await reader.read()).done) {
+ yield next.value;
+ }
+ } else if (encodedValue[Symbol.asyncIterator]) {
+ for await (let asyncValue of encodedValue) {
+ restartEncoding();
+ if (asyncValue)
+ yield* encodeObjectAsAsyncIterable(asyncValue, iterateProperties.async || (iterateProperties.async = {}));
+ else yield encoder.encode(asyncValue);
+ }
+ } else {
+ yield encodedValue;
+ }
+ }
+ }
+ }
+ useBuffer(buffer) {
+ // this means we are finished using our own buffer and we can write over it safely
+ target = buffer;
+ targetView = new DataView(target.buffer, target.byteOffset, target.byteLength);
+ position = 0;
+ }
+ clearSharedData() {
+ if (this.structures)
+ this.structures = [];
+ if (this.sharedValues)
+ this.sharedValues = undefined;
+ }
+ updateSharedData() {
+ let lastVersion = this.sharedVersion || 0;
+ this.sharedVersion = lastVersion + 1;
+ let structuresCopy = this.structures.slice(0);
+ let sharedData = new SharedData(structuresCopy, this.sharedValues, this.sharedVersion);
+ let saveResults = this.saveShared(sharedData,
+ existingShared => (existingShared && existingShared.version || 0) == lastVersion);
+ if (saveResults === false) {
+ // get updated structures and try again if the update failed
+ sharedData = this.getShared() || {};
+ this.structures = sharedData.structures || [];
+ this.sharedValues = sharedData.packedValues;
+ this.sharedVersion = sharedData.version;
+ this.structures.nextId = this.structures.length;
+ } else {
+ // restore structures
+ structuresCopy.forEach((structure, i) => this.structures[i] = structure);
+ }
+ // saveShared may fail to write and reload, or may have reloaded to check compatibility and overwrite saved data, either way load the correct shared data
+ return saveResults
+ }
+ }
+ function writeEntityLength(length, majorValue) {
+ if (length < 0x18)
+ target[position++] = majorValue | length;
+ else if (length < 0x100) {
+ target[position++] = majorValue | 0x18;
+ target[position++] = length;
+ } else if (length < 0x10000) {
+ target[position++] = majorValue | 0x19;
+ target[position++] = length >> 8;
+ target[position++] = length & 0xff;
+ } else {
+ target[position++] = majorValue | 0x1a;
+ targetView.setUint32(position, length);
+ position += 4;
+ }
- // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
- // The _isBuffer check is for Safari 5-7 support, because it's missing
- // Object.prototype.constructor. Remove this eventually
- function isBuffer(obj) {
- return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
+ }
+ class SharedData {
+ constructor(structures, values, version) {
+ this.structures = structures;
+ this.packedValues = values;
+ this.version = version;
+ }
}
- function isFastBuffer (obj) {
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+ function writeArrayHeader(length) {
+ if (length < 0x18)
+ target[position++] = 0x80 | length;
+ else if (length < 0x100) {
+ target[position++] = 0x98;
+ target[position++] = length;
+ } else if (length < 0x10000) {
+ target[position++] = 0x99;
+ target[position++] = length >> 8;
+ target[position++] = length & 0xff;
+ } else {
+ target[position++] = 0x9a;
+ targetView.setUint32(position, length);
+ position += 4;
+ }
}
- // For Node v0.10 support. Remove this eventually.
- function isSlowBuffer (obj) {
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
+ const BlobConstructor = typeof Blob === 'undefined' ? function(){} : Blob;
+ function isBlob(object) {
+ if (object instanceof BlobConstructor)
+ return true;
+ let tag = object[Symbol.toStringTag];
+ return tag === 'Blob' || tag === 'File';
+ }
+ function findRepetitiveStrings(value, packedValues) {
+ switch(typeof value) {
+ case 'string':
+ if (value.length > 3) {
+ if (packedValues.objectMap[value] > -1 || packedValues.values.length >= packedValues.maxValues)
+ return
+ let packedStatus = packedValues.get(value);
+ if (packedStatus) {
+ if (++packedStatus.count == 2) {
+ packedValues.values.push(value);
+ }
+ } else {
+ packedValues.set(value, {
+ count: 1,
+ });
+ if (packedValues.samplingPackedValues) {
+ let status = packedValues.samplingPackedValues.get(value);
+ if (status)
+ status.count++;
+ else
+ packedValues.samplingPackedValues.set(value, {
+ count: 1,
+ });
+ }
+ }
+ }
+ break
+ case 'object':
+ if (value) {
+ if (value instanceof Array) {
+ for (let i = 0, l = value.length; i < l; i++) {
+ findRepetitiveStrings(value[i], packedValues);
+ }
+
+ } else {
+ let includeKeys = !packedValues.encoder.useRecords;
+ for (var key in value) {
+ if (value.hasOwnProperty(key)) {
+ if (includeKeys)
+ findRepetitiveStrings(key, packedValues);
+ findRepetitiveStrings(value[key], packedValues);
+ }
+ }
+ }
+ }
+ break
+ case 'function': console.log(value);
+ }
+ }
+ const isLittleEndianMachine = new Uint8Array(new Uint16Array([1]).buffer)[0] == 1;
+ extensionClasses = [ Date, Set, Error, RegExp, Tag, ArrayBuffer,
+ Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array,
+ typeof BigUint64Array == 'undefined' ? function() {} : BigUint64Array, Int8Array, Int16Array, Int32Array,
+ typeof BigInt64Array == 'undefined' ? function() {} : BigInt64Array,
+ Float32Array, Float64Array, SharedData ];
+
+ //Object.getPrototypeOf(Uint8Array.prototype).constructor /*TypedArray*/
+ extensions = [{ // Date
+ tag: 1,
+ encode(date, encode) {
+ let seconds = date.getTime() / 1000;
+ if ((this.useTimestamp32 || date.getMilliseconds() === 0) && seconds >= 0 && seconds < 0x100000000) {
+ // Timestamp 32
+ target[position++] = 0x1a;
+ targetView.setUint32(position, seconds);
+ position += 4;
+ } else {
+ // Timestamp float64
+ target[position++] = 0xfb;
+ targetView.setFloat64(position, seconds);
+ position += 8;
+ }
+ }
+ }, { // Set
+ tag: 258, // https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md
+ encode(set, encode) {
+ let array = Array.from(set);
+ encode(array);
+ }
+ }, { // Error
+ tag: 27, // http://cbor.schmorp.de/generic-object
+ encode(error, encode) {
+ encode([ error.name, error.message ]);
+ }
+ }, { // RegExp
+ tag: 27, // http://cbor.schmorp.de/generic-object
+ encode(regex, encode) {
+ encode([ 'RegExp', regex.source, regex.flags ]);
+ }
+ }, { // Tag
+ getTag(tag) {
+ return tag.tag
+ },
+ encode(tag, encode) {
+ encode(tag.value);
+ }
+ }, { // ArrayBuffer
+ encode(arrayBuffer, encode, makeRoom) {
+ writeBuffer(arrayBuffer, makeRoom);
+ }
+ }, { // Uint8Array
+ getTag(typedArray) {
+ if (typedArray.constructor === Uint8Array) {
+ if (this.tagUint8Array || hasNodeBuffer && this.tagUint8Array !== false)
+ return 64;
+ } // else no tag
+ },
+ encode(typedArray, encode, makeRoom) {
+ writeBuffer(typedArray, makeRoom);
+ }
+ },
+ typedArrayEncoder(68, 1),
+ typedArrayEncoder(69, 2),
+ typedArrayEncoder(70, 4),
+ typedArrayEncoder(71, 8),
+ typedArrayEncoder(72, 1),
+ typedArrayEncoder(77, 2),
+ typedArrayEncoder(78, 4),
+ typedArrayEncoder(79, 8),
+ typedArrayEncoder(85, 4),
+ typedArrayEncoder(86, 8),
+ {
+ encode(sharedData, encode) { // write SharedData
+ let packedValues = sharedData.packedValues || [];
+ let sharedStructures = sharedData.structures || [];
+ if (packedValues.values.length > 0) {
+ target[position++] = 0xd8; // one-byte tag
+ target[position++] = 51; // tag 51 for packed shared structures https://www.potaroo.net/ietf/ids/draft-ietf-cbor-packed-03.txt
+ writeArrayHeader(4);
+ let valuesArray = packedValues.values;
+ encode(valuesArray);
+ writeArrayHeader(0); // prefixes
+ writeArrayHeader(0); // suffixes
+ packedObjectMap = Object.create(sharedPackedObjectMap || null);
+ for (let i = 0, l = valuesArray.length; i < l; i++) {
+ packedObjectMap[valuesArray[i]] = i;
+ }
+ }
+ if (sharedStructures) {
+ targetView.setUint32(position, 0xd9dffe00);
+ position += 3;
+ let definitions = sharedStructures.slice(0);
+ definitions.unshift(0xe000);
+ definitions.push(new Tag(sharedData.version, 0x53687264));
+ encode(definitions);
+ } else
+ encode(new Tag(sharedData.version, 0x53687264));
+ }
+ }];
+ function typedArrayEncoder(tag, size) {
+ if (!isLittleEndianMachine && size > 1)
+ tag -= 4; // the big endian equivalents are 4 less
+ return {
+ tag: tag,
+ encode: function writeExtBuffer(typedArray, encode) {
+ let length = typedArray.byteLength;
+ let offset = typedArray.byteOffset || 0;
+ let buffer = typedArray.buffer || typedArray;
+ encode(hasNodeBuffer ? Buffer.from(buffer, offset, length) :
+ new Uint8Array(buffer, offset, length));
+ }
+ }
+ }
+ function writeBuffer(buffer, makeRoom) {
+ let length = buffer.byteLength;
+ if (length < 0x18) {
+ target[position++] = 0x40 + length;
+ } else if (length < 0x100) {
+ target[position++] = 0x58;
+ target[position++] = length;
+ } else if (length < 0x10000) {
+ target[position++] = 0x59;
+ target[position++] = length >> 8;
+ target[position++] = length & 0xff;
+ } else {
+ target[position++] = 0x5a;
+ targetView.setUint32(position, length);
+ position += 4;
+ }
+ if (position + length >= target.length) {
+ makeRoom(position + length);
+ }
+ // if it is already a typed array (has an ArrayBuffer), use that, but if it is an ArrayBuffer itself,
+ // must wrap it to set it.
+ target.set(buffer.buffer ? buffer : new Uint8Array(buffer), position);
+ position += length;
}
- let decoder;
- try {
- decoder = new TextDecoder();
- } catch(error) {}
- let src;
- let srcEnd;
- let position$1 = 0;
- const RECORD_TAG_ID = 0x69;
- const STOP_CODE = {};
- let currentDecoder = {};
- let currentStructures;
- let srcString;
- let srcStringStart = 0;
- let srcStringEnd = 0;
- let referenceMap;
- let currentExtensions = [];
- let dataView;
- let restoreMapsAsObject;
- let defaultOptions = {
- useRecords: false,
- mapsAsObjects: true
- };
- let sequentialMode = false;
-
- class Decoder {
- constructor(options) {
- if (options) {
- if (options.useRecords === false && options.mapsAsObjects === undefined)
- options.mapsAsObjects = true;
- if (options.getStructures && !options.structures)
- (options.structures = []).uninitialized = true; // this is what we use to denote an uninitialized structures
- }
- Object.assign(this, options);
- }
- decode(source, end) {
- if (src) {
- // re-entrant execution, save the state and restore it after we do this decode
- return saveState(() => {
- clearSource();
- return this ? this.decode(source, end) : Decoder.prototype.decode.call(defaultOptions, source, end)
- })
- }
- srcEnd = end > -1 ? end : source.length;
- position$1 = 0;
- srcStringEnd = 0;
- srcString = null;
- src = source;
- // this provides cached access to the data view for a buffer if it is getting reused, which is a recommend
- // technique for getting data from a database where it can be copied into an existing buffer instead of creating
- // new ones
- dataView = source.dataView || (source.dataView = new DataView(source.buffer, source.byteOffset, source.byteLength));
- if (this) {
- currentDecoder = this;
- if (this.structures) {
- currentStructures = this.structures;
- return checkedRead()
- } else if (!currentStructures || currentStructures.length > 0) {
- currentStructures = [];
- }
- } else {
- currentDecoder = defaultOptions;
- if (!currentStructures || currentStructures.length > 0)
- currentStructures = [];
- }
- return checkedRead()
- }
- decodeMultiple(source, forEach) {
- let values, lastPosition = 0;
- try {
- let size = source.length;
- sequentialMode = true;
- let value = this ? this.decode(source, size) : defaultDecoder.decode(source, size);
- if (forEach) {
- forEach(value);
- while(position$1 < size) {
- lastPosition = position$1;
- if (forEach(checkedRead()) === false) {
- return
- }
- }
- }
- else {
- values = [ value ];
- while(position$1 < size) {
- lastPosition = position$1;
- values.push(checkedRead());
- }
- return values
- }
- } catch(error) {
- error.lastPosition = lastPosition;
- error.values = values;
- throw error
- } finally {
- sequentialMode = false;
- clearSource();
- }
- }
- }
- function checkedRead() {
- try {
- let result = read();
- if (position$1 == srcEnd) {
- // finished reading this source, cleanup references
- currentStructures = null;
- src = null;
- if (referenceMap)
- referenceMap = null;
- } else if (position$1 > srcEnd) {
- // over read
- let error = new Error('Unexpected end of CBOR data');
- error.incomplete = true;
- throw error
- } else if (!sequentialMode) {
- throw new Error('Data read, but end of buffer not reached')
- }
- // else more to read, but we are reading sequentially, so don't clear source yet
- return result
- } catch(error) {
- clearSource();
- if (error instanceof RangeError || error.message.startsWith('Unexpected end of buffer')) {
- error.incomplete = true;
- }
- throw error
- }
- }
-
- function read() {
- let token = src[position$1++];
- let majorType = token >> 5;
- token = token & 0x1f;
- if (token > 0x17) {
- switch (token) {
- case 0x18:
- token = src[position$1++];
- break
- case 0x19:
- if (majorType == 7) {
- return getFloat16()
- }
- token = dataView.getUint16(position$1);
- position$1 += 2;
- break
- case 0x1a:
- if (majorType == 7) {
- let value = dataView.getFloat32(position$1);
- if (currentDecoder.useFloat32 > 2) {
- // this does rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
- let multiplier = mult10[((src[position$1] & 0x7f) << 1) | (src[position$1 + 1] >> 7)];
- position$1 += 4;
- return ((multiplier * value + (value > 0 ? 0.5 : -0.5)) >> 0) / multiplier
- }
- position$1 += 4;
- return value
- }
- token = dataView.getUint32(position$1);
- position$1 += 4;
- break
- case 0x1b:
- if (majorType == 7) {
- let value = dataView.getFloat64(position$1);
- position$1 += 8;
- return value
- }
- if (currentDecoder.uint64AsNumber)
- return src[position$1++] * 0x100000000000000 + src[position$1++] * 0x1000000000000 + src[position$1++] * 0x10000000000 + src[position$1++] * 0x100000000 +
- src[position$1++] * 0x1000000 + (src[position$1++] << 16) + (src[position$1++] << 8) + src[position$1++]
- token = dataView.getBigUint64(position$1);
- position$1 += 8;
- break
- case 0x1f:
- // indefinite length
- switch(majorType) {
- case 2: // byte string
- case 3: // text string
- case 4: // array
- let array = [];
- let value, i = 0;
- while ((value = read()) != STOP_CODE) {
- array[i++] = value;
- }
- return majorType == 4 ? array : majorType == 3 ? array.join('') : Buffer.concat(array)
- case 5: // map
- let key;
- if (currentDecoder.mapsAsObjects) {
- let object = {};
- while ((key = readKey()) != STOP_CODE)
- object[key] = read();
- return object
- } else {
- if (restoreMapsAsObject) {
- currentDecoder.mapsAsObjects = true;
- restoreMapsAsObject = false;
- }
- let map = new Map();
- while ((key = read()) != STOP_CODE)
- map.set(key, read());
- return map
- }
- case 7:
- return STOP_CODE
- default:
- throw new Error('Invalid major type for indefinite length ' + majorType)
- }
- default:
- throw new Error('Unknown token ' + token)
- }
- }
- switch (majorType) {
- case 0: // positive int
- return token
- case 1: // negative int
- return ~token
- case 2: // buffer
- return readBin(token)
- case 3: // string
- if (srcStringEnd >= position$1) {
- return srcString.slice(position$1 - srcStringStart, (position$1 += token) - srcStringStart)
- }
- if (srcStringEnd == 0 && srcEnd < 140 && token < 32) {
- // for small blocks, avoiding the overhead of the extract call is helpful
- let string = token < 16 ? shortStringInJS(token) : longStringInJS(token);
- if (string != null)
- return string
- }
- return readFixedString(token)
- case 4: // array
- let array = new Array(token);
- for (let i = 0; i < token; i++) {
- array[i] = read();
- }
- return array
- case 5: // map
- if (currentDecoder.mapsAsObjects) {
- let object = {};
- for (let i = 0; i < token; i++) {
- object[readKey()] = read();
- }
- return object
- } else {
- if (restoreMapsAsObject) {
- currentDecoder.mapsAsObjects = true;
- restoreMapsAsObject = false;
- }
- let map = new Map();
- for (let i = 0; i < token; i++) {
- map.set(read(), read());
- }
- return map
- }
- case 6: // extension
- if ((token >> 8) == RECORD_TAG_ID) { // record structures
- let structure = currentStructures[token & 0xff];
- if (structure) {
- if (!structure.read)
- structure.read = createStructureReader(structure);
- return structure.read()
- } else if (currentDecoder.getStructures) {
- let updatedStructures = saveState(() => {
- // save the state in case getStructures modifies our buffer
- src = null;
- return currentDecoder.getStructures()
- });
- if (currentStructures === true)
- currentDecoder.structures = currentStructures = updatedStructures;
- else
- currentStructures.splice.apply(currentStructures, [0, updatedStructures.length].concat(updatedStructures));
- structure = currentStructures[token & 0xff];
- if (structure) {
- if (!structure.read)
- structure.read = createStructureReader(structure);
- return structure.read()
- } else
- return token
- } else
- return token
- } else {
- let extension = currentExtensions[token];
- if (extension) {
- if (extension.handlesRead)
- return extension(read)
- else
- return extension(read())
- }
- else
- return new Tag(read())
- }
- case 7: // fixed value
- switch (token) {
- case 0x14: return false
- case 0x15: return true
- case 0x16: return null
- case 0x17: return; // undefined
- case 0x1f:
- default:
- throw new Error('Unknown token ' + token)
- }
- default: // negative int
- if (isNaN(token)) {
- let error = new Error('Unexpected end of CBOR data');
- error.incomplete = true;
- throw error
- }
- throw new Error('Unknown CBOR token ' + token)
- }
- }
- const validName = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
- function createStructureReader(structure) {
- let l = structure.length;
- function readObject() {
- // This initial function is quick to instantiate, but runs slower. After several iterations pay the cost to build the faster function
- if (readObject.count++ > 2) {
- this.read = (new Function('a', 'r', 'return function(){a();return {' + structure.map(key => validName.test(key) ? key + ':r()' : ('[' + JSON.stringify(key) + ']:r()')).join(',') + '}}'))(readArrayHeader, read);
- return this.read()
- }
- readArrayHeader();
- let object = {};
- for (let i = 0; i < l; i++) {
- let key = structure[i];
- object[key] = read();
- }
- return object
- }
- readObject.count = 0;
- return readObject
- }
-
- function readArrayHeader(expectedLength) {
- // consume the array header, TODO: check expected length
- let token = src[position$1++];
- //let majorType = token >> 5
- token = token & 0x1f;
- if (token > 0x17) {
- switch (token) {
- case 0x18: position$1++;
- break
- case 0x19: position$1 += 2;
- break
- case 0x1a: position$1 += 4;
- }
- }
- }
-
- let readFixedString = readStringJS;
- function readStringJS(length) {
- let result;
- if (length < 16) {
- if (result = shortStringInJS(length))
- return result
- }
- if (length > 64 && decoder)
- return decoder.decode(src.subarray(position$1, position$1 += length))
- const end = position$1 + length;
- const units = [];
- result = '';
- while (position$1 < end) {
- const byte1 = src[position$1++];
- if ((byte1 & 0x80) === 0) {
- // 1 byte
- units.push(byte1);
- } else if ((byte1 & 0xe0) === 0xc0) {
- // 2 bytes
- const byte2 = src[position$1++] & 0x3f;
- units.push(((byte1 & 0x1f) << 6) | byte2);
- } else if ((byte1 & 0xf0) === 0xe0) {
- // 3 bytes
- const byte2 = src[position$1++] & 0x3f;
- const byte3 = src[position$1++] & 0x3f;
- units.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3);
- } else if ((byte1 & 0xf8) === 0xf0) {
- // 4 bytes
- const byte2 = src[position$1++] & 0x3f;
- const byte3 = src[position$1++] & 0x3f;
- const byte4 = src[position$1++] & 0x3f;
- let unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4;
- if (unit > 0xffff) {
- unit -= 0x10000;
- units.push(((unit >>> 10) & 0x3ff) | 0xd800);
- unit = 0xdc00 | (unit & 0x3ff);
- }
- units.push(unit);
- } else {
- units.push(byte1);
- }
-
- if (units.length >= 0x1000) {
- result += fromCharCode.apply(String, units);
- units.length = 0;
- }
- }
-
- if (units.length > 0) {
- result += fromCharCode.apply(String, units);
- }
-
- return result
- }
- let fromCharCode = String.fromCharCode;
- function longStringInJS(length) {
- let start = position$1;
- let bytes = new Array(length);
- for (let i = 0; i < length; i++) {
- const byte = src[position$1++];
- if ((byte & 0x80) > 0) {
- position$1 = start;
- return
- }
- bytes[i] = byte;
- }
- return fromCharCode.apply(String, bytes)
- }
- function shortStringInJS(length) {
- if (length < 4) {
- if (length < 2) {
- if (length === 0)
- return ''
- else {
- let a = src[position$1++];
- if ((a & 0x80) > 1) {
- position$1 -= 1;
- return
- }
- return fromCharCode(a)
- }
- } else {
- let a = src[position$1++];
- let b = src[position$1++];
- if ((a & 0x80) > 0 || (b & 0x80) > 0) {
- position$1 -= 2;
- return
- }
- if (length < 3)
- return fromCharCode(a, b)
- let c = src[position$1++];
- if ((c & 0x80) > 0) {
- position$1 -= 3;
- return
- }
- return fromCharCode(a, b, c)
- }
- } else {
- let a = src[position$1++];
- let b = src[position$1++];
- let c = src[position$1++];
- let d = src[position$1++];
- if ((a & 0x80) > 0 || (b & 0x80) > 0 || (c & 0x80) > 0 || (d & 0x80) > 0) {
- position$1 -= 4;
- return
- }
- if (length < 6) {
- if (length === 4)
- return fromCharCode(a, b, c, d)
- else {
- let e = src[position$1++];
- if ((e & 0x80) > 0) {
- position$1 -= 5;
- return
- }
- return fromCharCode(a, b, c, d, e)
- }
- } else if (length < 8) {
- let e = src[position$1++];
- let f = src[position$1++];
- if ((e & 0x80) > 0 || (f & 0x80) > 0) {
- position$1 -= 6;
- return
- }
- if (length < 7)
- return fromCharCode(a, b, c, d, e, f)
- let g = src[position$1++];
- if ((g & 0x80) > 0) {
- position$1 -= 7;
- return
- }
- return fromCharCode(a, b, c, d, e, f, g)
- } else {
- let e = src[position$1++];
- let f = src[position$1++];
- let g = src[position$1++];
- let h = src[position$1++];
- if ((e & 0x80) > 0 || (f & 0x80) > 0 || (g & 0x80) > 0 || (h & 0x80) > 0) {
- position$1 -= 8;
- return
- }
- if (length < 10) {
- if (length === 8)
- return fromCharCode(a, b, c, d, e, f, g, h)
- else {
- let i = src[position$1++];
- if ((i & 0x80) > 0) {
- position$1 -= 9;
- return
- }
- return fromCharCode(a, b, c, d, e, f, g, h, i)
- }
- } else if (length < 12) {
- let i = src[position$1++];
- let j = src[position$1++];
- if ((i & 0x80) > 0 || (j & 0x80) > 0) {
- position$1 -= 10;
- return
- }
- if (length < 11)
- return fromCharCode(a, b, c, d, e, f, g, h, i, j)
- let k = src[position$1++];
- if ((k & 0x80) > 0) {
- position$1 -= 11;
- return
- }
- return fromCharCode(a, b, c, d, e, f, g, h, i, j, k)
- } else {
- let i = src[position$1++];
- let j = src[position$1++];
- let k = src[position$1++];
- let l = src[position$1++];
- if ((i & 0x80) > 0 || (j & 0x80) > 0 || (k & 0x80) > 0 || (l & 0x80) > 0) {
- position$1 -= 12;
- return
- }
- if (length < 14) {
- if (length === 12)
- return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l)
- else {
- let m = src[position$1++];
- if ((m & 0x80) > 0) {
- position$1 -= 13;
- return
- }
- return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m)
- }
- } else {
- let m = src[position$1++];
- let n = src[position$1++];
- if ((m & 0x80) > 0 || (n & 0x80) > 0) {
- position$1 -= 14;
- return
- }
- if (length < 15)
- return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n)
- let o = src[position$1++];
- if ((o & 0x80) > 0) {
- position$1 -= 15;
- return
- }
- return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
- }
- }
- }
- }
- }
-
- function readBin(length) {
- return currentDecoder.copyBuffers ?
- // specifically use the copying slice (not the node one)
- Uint8Array.prototype.slice.call(src, position$1, position$1 += length) :
- src.subarray(position$1, position$1 += length)
- }
-
- function getFloat16() {
- let byte0 = src[position$1++];
- let byte1 = src[position$1++];
- let half = (byte0 << 8) + byte1;
- let exp = (half >> 10) & 0x1f;
- let mant = half & 0x3ff;
- let val;
- if (exp == 0) val = Math.exp(mant, -24);
- else if (exp != 31) val = Math.exp(mant + 1024, exp - 25);
- else val = mant == 0 ? Infinity : NaN;
- return half & 0x8000 ? -val : val
- }
-
- let keyCache = new Array(4096);
- function readKey() {
- let length = src[position$1++];
- if (length >= 0x60 && length < 0x78) {
- // fixstr, potentially use key cache
- length = length - 0x60;
- if (srcStringEnd >= position$1) // if it has been extracted, must use it (and faster anyway)
- return srcString.slice(position$1 - srcStringStart, (position$1 += length) - srcStringStart)
- else if (!(srcStringEnd == 0 && srcEnd < 180))
- return readFixedString(length)
- } else { // not cacheable, go back and do a standard read
- position$1--;
- return read()
- }
- let key = ((length << 5) ^ (length > 1 ? dataView.getUint16(position$1) : length > 0 ? src[position$1] : 0)) & 0xfff;
- let entry = keyCache[key];
- let checkPosition = position$1;
- let end = position$1 + length - 3;
- let chunk;
- let i = 0;
- if (entry && entry.bytes == length) {
- while (checkPosition < end) {
- chunk = dataView.getUint32(checkPosition);
- if (chunk != entry[i++]) {
- checkPosition = 0x70000000;
- break
- }
- checkPosition += 4;
- }
- end += 3;
- while (checkPosition < end) {
- chunk = src[checkPosition++];
- if (chunk != entry[i++]) {
- checkPosition = 0x70000000;
- break
- }
- }
- if (checkPosition === end) {
- position$1 = checkPosition;
- return entry.string
- }
- end -= 3;
- checkPosition = position$1;
- }
- entry = [];
- keyCache[key] = entry;
- entry.bytes = length;
- while (checkPosition < end) {
- chunk = dataView.getUint32(checkPosition);
- entry.push(chunk);
- checkPosition += 4;
- }
- end += 3;
- while (checkPosition < end) {
- chunk = src[checkPosition++];
- entry.push(chunk);
- }
- // for small blocks, avoiding the overhead of the extract call is helpful
- let string = length < 16 ? shortStringInJS(length) : longStringInJS(length);
- if (string != null)
- return entry.string = string
- return entry.string = readFixedString(length)
- }
-
- class Tag {
- constructor(value) {
- this.value = value;
- }
- }
-
- let glbl = typeof window == 'object' ? window : global$1;
-
- currentExtensions[0] = (dateString) => {
- // string date extension
- return new Date(dateString)
- };
-
- currentExtensions[1] = (epochSec) => {
- // numeric date extension
- return new Date(epochSec * 1000)
- };
-
- currentExtensions[2] = (buffer) => {
- // bigint extension
- return new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength).getBigUint64(0)
- };
-
- currentExtensions[3] = (buffer) => {
- // negative bigint extension
- return BigInt(-1) - (new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength).getBigUint64(0))
- };
-
- // the registration of the record definition extension (tag 105)
- const recordDefinition = () => {
- let definition = read();
- let structure = definition[0];
- let id = definition[1];
- currentStructures[id & 0xff] = structure;
- structure.read = createStructureReader(structure);
- let object = {};
- for (let i = 2,l = definition.length; i < l; i++) {
- let key = structure[i - 2];
- object[key] = definition[i];
- }
- return object
- };
-
- recordDefinition.handlesRead = true;
- currentExtensions[RECORD_TAG_ID] = recordDefinition;
-
- currentExtensions[27] = (data) => { // http://cbor.schmorp.de/generic-object
- return (glbl[data[0]] || Error)(data[1], data[2])
- };
-
- currentExtensions[40009] = (id) => {
- // id extension (for structured clones)
- if (!referenceMap)
- referenceMap = new Map();
- let token = src[position$1];
- let target;
- // TODO: handle Maps, Sets, and other types that can cycle; this is complicated, because you potentially need to read
- // ahead past references to record structure definitions
- if ((token >> 5) == 4)
- target = [];
- else
- target = {};
-
- let refEntry = { target }; // a placeholder object
- referenceMap.set(id, refEntry);
- let targetProperties = read(); // read the next value as the target object to id
- if (refEntry.used) // there is a cycle, so we have to assign properties to original target
- return Object.assign(target, targetProperties)
- refEntry.target = targetProperties; // the placeholder wasn't used, replace with the deserialized one
- return targetProperties // no cycle, can just use the returned read object
- };
-
- currentExtensions[40010] = (id) => {
- // pointer extension (for structured clones)
- let refEntry = referenceMap.get(id);
- refEntry.used = true;
- return refEntry.target
- };
-
- currentExtensions[258] = (array) => new Set(array); // https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md
- (currentExtensions[259] = (read) => {
- // https://github.com/shanewholloway/js-cbor-codec/blob/master/docs/CBOR-259-spec
- // for decoding as a standard Map
- if (currentDecoder.mapsAsObjects) {
- currentDecoder.mapsAsObjects = false;
- restoreMapsAsObject = true;
- }
- return read()
- }).handlesRead = true;
-
-
- const typedArrays = ['Uint8', 'Uint8Clamped', 'Uint16', 'Uint32', 'BigUint64','Int8', 'Int16', 'Int32', 'BigInt64', 'Float32', 'Float64'].map(type => type + 'Array');
- const typedArrayTags = [64, 68, 69, 70, 71, 72, 77, 78, 79, 81, 82];
- for (let i = 0; i < typedArrays.length; i++) {
- registerTypedArray(typedArrays[i], typedArrayTags[i]);
- }
- function registerTypedArray(typedArrayName, tag) {
- currentExtensions[tag] = (buffer) => {
- if (!typedArrayName)
- throw new Error('Could not find typed array for code ' + typeCode)
- // we have to always slice/copy here to get a new ArrayBuffer that is word/byte aligned
- return new glbl[typedArrayName](Uint8Array.prototype.slice.call(buffer, 0).buffer)
- };
- }
-
- function saveState(callback) {
- let savedSrcEnd = srcEnd;
- let savedPosition = position$1;
- let savedSrcStringStart = srcStringStart;
- let savedSrcStringEnd = srcStringEnd;
- let savedSrcString = srcString;
- let savedReferenceMap = referenceMap;
- // TODO: We may need to revisit this if we do more external calls to user code (since it could be slow)
- let savedSrc = new Uint8Array(src.slice(0, srcEnd)); // we copy the data in case it changes while external data is processed
- let savedStructures = currentStructures;
- let savedDecoder = currentDecoder;
- let savedSequentialMode = sequentialMode;
- let value = callback();
- srcEnd = savedSrcEnd;
- position$1 = savedPosition;
- srcStringStart = savedSrcStringStart;
- srcStringEnd = savedSrcStringEnd;
- srcString = savedSrcString;
- referenceMap = savedReferenceMap;
- src = savedSrc;
- sequentialMode = savedSequentialMode;
- currentStructures = savedStructures;
- currentDecoder = savedDecoder;
- dataView = new DataView(src.buffer, src.byteOffset, src.byteLength);
- return value
- }
- function clearSource() {
- src = null;
- referenceMap = null;
- currentStructures = null;
- }
-
- function addExtension$1(extension) {
- currentExtensions[extension.tag] = extension.decode;
- }
-
- let mult10 = new Array(147); // this is a table matching binary exponents to the multiplier to determine significant digit rounding
- for (let i = 0; i < 256; i++) {
- mult10[i] = +('1e' + Math.floor(45.15 - i * 0.30103));
- }
- let defaultDecoder = new Decoder({ useRecords: false });
- defaultDecoder.decode;
- defaultDecoder.decodeMultiple;
+ function insertIds(serialized, idsToInsert) {
+ // insert the ids that need to be referenced for structured clones
+ let nextId;
+ let distanceToMove = idsToInsert.length * 2;
+ let lastEnd = serialized.length - distanceToMove;
+ idsToInsert.sort((a, b) => a.offset > b.offset ? 1 : -1);
+ for (let id = 0; id < idsToInsert.length; id++) {
+ let referee = idsToInsert[id];
+ referee.id = id;
+ for (let position of referee.references) {
+ serialized[position++] = id >> 8;
+ serialized[position] = id & 0xff;
+ }
+ }
+ while (nextId = idsToInsert.pop()) {
+ let offset = nextId.offset;
+ serialized.copyWithin(offset + distanceToMove, offset, lastEnd);
+ distanceToMove -= 2;
+ let position = offset + distanceToMove;
+ serialized[position++] = 0xd8;
+ serialized[position++] = 28; // http://cbor.schmorp.de/value-sharing
+ lastEnd = offset;
+ }
+ return serialized
+ }
+ function writeBundles(start, encode) {
+ targetView.setUint32(bundledStrings.position + start, position - bundledStrings.position - start + 1); // the offset to bundle
+ let writeStrings = bundledStrings;
+ bundledStrings = null;
+ encode(writeStrings[0]);
+ encode(writeStrings[1]);
+ }
- let textEncoder;
- try {
- textEncoder = new TextEncoder();
- } catch (error) {}
- let extensions, extensionClasses;
- const hasNodeBuffer = typeof Buffer !== 'undefined';
- const ByteArrayAllocate = hasNodeBuffer ? Buffer.allocUnsafeSlow : Uint8Array;
- const ByteArray = hasNodeBuffer ? Buffer : Uint8Array;
- const RECORD_STARTING_ID_PREFIX = 0x69; // tag 105/0x69
- const MAX_STRUCTURES = 0x100;
- const MAX_BUFFER_SIZE = hasNodeBuffer ? 0x100000000 : 0x7fd00000;
- let target;
- let targetView;
- let position = 0;
- let safeEnd;
- const RECORD_SYMBOL = Symbol('record-id');
- class Encoder extends Decoder {
- constructor(options) {
- super(options);
- this.offset = 0;
- let start;
- let sharedStructures;
- let hasSharedUpdate;
- let structures;
- let referenceMap;
- let lastSharedStructuresLength = 0;
- let encodeUtf8 = ByteArray.prototype.utf8Write ? function(string, position, maxBytes) {
- return target.utf8Write(string, position, maxBytes)
- } : (textEncoder && textEncoder.encodeInto) ?
- function(string, position) {
- return textEncoder.encodeInto(string, target.subarray(position)).written
- } : false;
-
- let encoder = this;
- let maxSharedStructures = 64;
- let isSequential = options && options.sequential;
- if (isSequential) {
- maxSharedStructures = 0;
- this.structures = [];
- }
- let recordIdsToRemove = [];
- let transitionsCount = 0;
- let serializationsSinceTransitionRebuild = 0;
- if (this.structures && this.structures.length > maxSharedStructures) {
- throw new Error('Too many shared structures')
- }
-
- this.encode = function(value) {
- if (!target) {
- target = new ByteArrayAllocate(8192);
- targetView = new DataView(target.buffer, 0, 8192);
- position = 0;
- }
- safeEnd = target.length - 10;
- if (safeEnd - position < 0x800) {
- // don't start too close to the end,
- target = new ByteArrayAllocate(target.length);
- targetView = new DataView(target.buffer, 0, target.length);
- safeEnd = target.length - 10;
- position = 0;
- }
- start = position;
- referenceMap = encoder.structuredClone ? new Map() : null;
- sharedStructures = encoder.structures;
- if (sharedStructures) {
- if (sharedStructures.uninitialized)
- encoder.structures = sharedStructures = encoder.getStructures();
- let sharedStructuresLength = sharedStructures.length;
- if (sharedStructuresLength > maxSharedStructures && !isSequential)
- sharedStructuresLength = maxSharedStructures;
- if (!sharedStructures.transitions) {
- // rebuild our structure transitions
- sharedStructures.transitions = Object.create(null);
- for (let i = 0; i < sharedStructuresLength; i++) {
- let keys = sharedStructures[i];
- if (!keys)
- continue
- let nextTransition, transition = sharedStructures.transitions;
- for (let i =0, l = keys.length; i < l; i++) {
- let key = keys[i];
- nextTransition = transition[key];
- if (!nextTransition) {
- nextTransition = transition[key] = Object.create(null);
- }
- transition = nextTransition;
- }
- transition[RECORD_SYMBOL] = i;
- }
- lastSharedStructuresLength = sharedStructures.length;
- }
- if (!isSequential)
- sharedStructures.nextId = sharedStructuresLength;
- }
- if (hasSharedUpdate)
- hasSharedUpdate = false;
- structures = sharedStructures || [];
- try {
- encode(value);
- encoder.offset = position; // update the offset so next serialization doesn't write over our buffer, but can continue writing to same buffer sequentially
- if (referenceMap && referenceMap.idsToInsert) {
- position += referenceMap.idsToInsert.length * 8;
- if (position > safeEnd)
- makeRoom(position);
- encoder.offset = position;
- let serialized = insertIds(target.subarray(start, position), referenceMap.idsToInsert);
- referenceMap = null;
- return serialized
- }
- return target.subarray(start, position) // position can change if we call encode again in saveStructures, so we get the buffer now
- } finally {
- if (sharedStructures) {
- if (serializationsSinceTransitionRebuild < 10)
- serializationsSinceTransitionRebuild++;
- if (transitionsCount > 10000) {
- // force a rebuild occasionally after a lot of transitions so it can get cleaned up
- sharedStructures.transitions = null;
- serializationsSinceTransitionRebuild = 0;
- transitionsCount = 0;
- if (recordIdsToRemove.length > 0)
- recordIdsToRemove = [];
- } else if (recordIdsToRemove.length > 0 && !isSequential) {
- for (let i = 0, l = recordIdsToRemove.length; i < l; i++) {
- recordIdsToRemove[i][RECORD_SYMBOL] = undefined;
- }
- recordIdsToRemove = [];
- }
- if (hasSharedUpdate && encoder.saveStructures) {
- if (encoder.structures.length > maxSharedStructures) {
- encoder.structures = encoder.structures.slice(0, maxSharedStructures);
- }
-
- if (encoder.saveStructures(encoder.structures, lastSharedStructuresLength) === false) {
- // get updated structures and try again if the update failed
- encoder.structures = encoder.getStructures() || [];
- return encoder.encode(value)
- }
- lastSharedStructuresLength = encoder.structures.length;
- }
- }
- }
- };
- const encode = (value) => {
- if (position > safeEnd)
- target = makeRoom(position);
-
- var type = typeof value;
- var length;
- if (type === 'string') {
- let strLength = value.length;
- let headerSize;
- // first we estimate the header size, so we can write to the correct location
- if (strLength < 0x20) {
- headerSize = 1;
- } else if (strLength < 0x100) {
- headerSize = 2;
- } else if (strLength < 0x10000) {
- headerSize = 3;
- } else {
- headerSize = 5;
- }
- let maxBytes = strLength * 3;
- if (position + maxBytes > safeEnd)
- target = makeRoom(position + maxBytes);
-
- if (strLength < 0x40 || !encodeUtf8) {
- let i, c1, c2, strPosition = position + headerSize;
- for (i = 0; i < strLength; i++) {
- c1 = value.charCodeAt(i);
- if (c1 < 0x80) {
- target[strPosition++] = c1;
- } else if (c1 < 0x800) {
- target[strPosition++] = c1 >> 6 | 0xc0;
- target[strPosition++] = c1 & 0x3f | 0x80;
- } else if (
- (c1 & 0xfc00) === 0xd800 &&
- ((c2 = value.charCodeAt(i + 1)) & 0xfc00) === 0xdc00
- ) {
- c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff);
- i++;
- target[strPosition++] = c1 >> 18 | 0xf0;
- target[strPosition++] = c1 >> 12 & 0x3f | 0x80;
- target[strPosition++] = c1 >> 6 & 0x3f | 0x80;
- target[strPosition++] = c1 & 0x3f | 0x80;
- } else {
- target[strPosition++] = c1 >> 12 | 0xe0;
- target[strPosition++] = c1 >> 6 & 0x3f | 0x80;
- target[strPosition++] = c1 & 0x3f | 0x80;
- }
- }
- length = strPosition - position - headerSize;
- } else {
- length = encodeUtf8(value, position + headerSize, maxBytes);
- }
-
- if (length < 0x18) {
- target[position++] = 0x60 | length;
- } else if (length < 0x100) {
- if (headerSize < 2) {
- target.copyWithin(position + 2, position + 1, position + 1 + length);
- }
- target[position++] = 0x78;
- target[position++] = length;
- } else if (length < 0x10000) {
- if (headerSize < 3) {
- target.copyWithin(position + 3, position + 2, position + 2 + length);
- }
- target[position++] = 0x79;
- target[position++] = length >> 8;
- target[position++] = length & 0xff;
- } else {
- if (headerSize < 5) {
- target.copyWithin(position + 5, position + 3, position + 3 + length);
- }
- target[position++] = 0x7a;
- targetView.setUint32(position, length);
- position += 4;
- }
- position += length;
- } else if (type === 'number') {
- if (value >>> 0 === value) {// positive integer, 32-bit or less
- // positive uint
- if (value < 0x18) {
- target[position++] = value;
- } else if (value < 0x100) {
- target[position++] = 0x18;
- target[position++] = value;
- } else if (value < 0x10000) {
- target[position++] = 0x19;
- target[position++] = value >> 8;
- target[position++] = value & 0xff;
- } else {
- target[position++] = 0x1a;
- targetView.setUint32(position, value);
- position += 4;
- }
- } else if (value >> 0 === value) { // negative integer
- if (value >= -0x18) {
- target[position++] = 0x1f - value;
- } else if (value >= -0x100) {
- target[position++] = 0x38;
- target[position++] = ~value;
- } else if (value >= -0x10000) {
- target[position++] = 0x39;
- targetView.setUint16(position, ~value);
- position += 2;
- } else {
- target[position++] = 0x3a;
- targetView.setUint32(position, ~value);
- position += 4;
- }
- } else {
- let useFloat32;
- if ((useFloat32 = this.useFloat32) > 0 && value < 0x100000000 && value >= -0x80000000) {
- target[position++] = 0xfa;
- targetView.setFloat32(position, value);
- let xShifted;
- if (useFloat32 < 4 ||
- // this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
- ((xShifted = value * mult10[((target[position] & 0x7f) << 1) | (target[position + 1] >> 7)]) >> 0) === xShifted) {
- position += 4;
- return
- } else
- position--; // move back into position for writing a double
- }
- target[position++] = 0xfb;
- targetView.setFloat64(position, value);
- position += 8;
- }
- } else if (type === 'object') {
- if (!value)
- target[position++] = 0xf6;
- else {
- if (referenceMap) {
- let referee = referenceMap.get(value);
- if (referee) {
- if (!referee.id) {
- let idsToInsert = referenceMap.idsToInsert || (referenceMap.idsToInsert = []);
- referee.id = idsToInsert.push(referee);
- }
- target[position++] = 0xd9;
- target[position++] = 40010 >> 8;
- target[position++] = 40010 & 0xff;
- target[position++] = 0x1a; // uint32
- targetView.setUint32(position, referee.id);
- position += 4;
- return
- } else
- referenceMap.set(value, { offset: position - start });
- }
- let constructor = value.constructor;
- if (constructor === Object) {
- writeObject(value, true);
- } else if (constructor === Array) {
- length = value.length;
- if (length < 0x18) {
- target[position++] = 0x80 | length;
- } else {
- writeArrayHeader(length);
- }
- for (let i = 0; i < length; i++) {
- encode(value[i]);
- }
- } else if (constructor === Map) {
- if (this.mapsAsObjects ? this.useTag259ForMaps !== false : this.useTag259ForMaps) {
- // use Tag 259 (https://github.com/shanewholloway/js-cbor-codec/blob/master/docs/CBOR-259-spec--explicit-maps.md) for maps if the user wants it that way
- target[position++] = 0xd9;
- target[position++] = 1;
- target[position++] = 3;
- }
- length = value.size;
- if (length < 0x18) {
- target[position++] = 0xa0 | length;
- } else if (length < 0x100) {
- target[position++] = 0xb8;
- target[position++] = length;
- } else if (length < 0x10000) {
- target[position++] = 0xb9;
- target[position++] = length >> 8;
- target[position++] = length & 0xff;
- } else {
- target[position++] = 0xba;
- targetView.setUint32(position, length);
- position += 4;
- }
- for (let [ key, entryValue ] of value) {
- encode(key);
- encode(entryValue);
- }
- } else {
- for (let i = 0, l = extensions.length; i < l; i++) {
- let extensionClass = extensionClasses[i];
- if (value instanceof extensionClass) {
- let extension = extensions[i];
- let tag = extension.tag;
- if (tag < 0x18) {
- target[position++] = 0xc0 | tag;
- } else if (tag < 0x100) {
- target[position++] = 0xd8;
- target[position++] = tag;
- } else if (tag < 0x10000) {
- target[position++] = 0xd9;
- target[position++] = tag >> 8;
- target[position++] = tag & 0xff;
- } else if (tag > -1) {
- target[position++] = 0xda;
- targetView.setUint32(position, tag);
- position += 4;
- } // else undefined, don't write tag
- extension.encode.call(this, value, encode, makeRoom);
- return
- }
- }
- if (value[Symbol.iterator]) {
- target[position++] = 0x9f; // indefinite length array
- for (let entry of value) {
- encode(entry);
- }
- target[position++] = 0xff; // stop-code
- return
- }
- // no extension found, write as object
- writeObject(value, !value.hasOwnProperty); // if it doesn't have hasOwnProperty, don't do hasOwnProperty checks
- }
- }
- } else if (type === 'boolean') {
- target[position++] = value ? 0xf5 : 0xf4;
- } else if (type === 'bigint') {
- if (value < (BigInt(1)<= 0) {
- // use an unsigned int as long as it fits
- target[position++] = 0x1b;
- targetView.setBigUint64(position, value);
- } else if (value > -(BigInt(1)< {
- // this method is slightly slower, but generates "preferred serialization" (optimally small for smaller objects)
- let keys = Object.keys(object);
- let length = keys.length;
- if (length < 0x18) {
- target[position++] = 0xa0 | length;
- } else if (length < 0x100) {
- target[position++] = 0xb8;
- target[position++] = length;
- } else if (length < 0x10000) {
- target[position++] = 0xb9;
- target[position++] = length >> 8;
- target[position++] = length & 0xff;
- } else {
- target[position++] = 0xba;
- targetView.setUint32(position, length);
- position += 4;
- }
- let key;
- for (let i = 0; i < length; i++) {
- encode(key = keys[i]);
- encode(object[key]);
- }
- } :
- (object, safePrototype) => {
- target[position++] = 0xb9; // always use map 16, so we can preallocate and set the length afterwards
- let objectOffset = position - start;
- position += 2;
- let size = 0;
- for (let key in object) {
- if (safePrototype || object.hasOwnProperty(key)) {
- encode(key);
- encode(object[key]);
- size++;
- }
- }
- target[objectOffset++ + start] = size >> 8;
- target[objectOffset + start] = size & 0xff;
- } :
-
- /* sharedStructures ? // For highly stable structures, using for-in can a little bit faster
- (object, safePrototype) => {
- let nextTransition, transition = structures.transitions || (structures.transitions = Object.create(null))
- let objectOffset = position++ - start
- let wroteKeys
- for (let key in object) {
- if (safePrototype || object.hasOwnProperty(key)) {
- nextTransition = transition[key]
- if (!nextTransition) {
- nextTransition = transition[key] = Object.create(null)
- nextTransition.__keys__ = (transition.__keys__ || []).concat([key])
- /*let keys = Object.keys(object)
- if
- let size = 0
- let startBranch = transition.__keys__ ? transition.__keys__.length : 0
- for (let i = 0, l = keys.length; i++) {
- let key = keys[i]
- size += key.length << 2
- if (i >= startBranch) {
- nextTransition = nextTransition[key] = Object.create(null)
- nextTransition.__keys__ = keys.slice(0, i + 1)
- }
- }
- makeRoom(position + size)
- nextTransition = transition[key]
- target.copy(target, )
- objectOffset
- }
- transition = nextTransition
- encode(object[key])
- }
- }
- let id = transition.id
- if (!id) {
- id = transition.id = structures.push(transition.__keys__) + 63
- if (sharedStructures.onUpdate)
- sharedStructures.onUpdate(id, transition.__keys__)
- }
- target[objectOffset + start] = id
- }*/
- (object) => {
- let keys = Object.keys(object);
- let nextTransition, transition = structures.transitions || (structures.transitions = Object.create(null));
- let newTransitions = 0;
- let length = keys.length;
- for (let i =0; i < length; i++) {
- let key = keys[i];
- nextTransition = transition[key];
- if (!nextTransition) {
- nextTransition = transition[key] = Object.create(null);
- newTransitions++;
- }
- transition = nextTransition;
- }
- let recordId = transition[RECORD_SYMBOL];
- if (recordId !== undefined) {
- target[position++] = 0xd9; // tag two byte
- target[position++] = RECORD_STARTING_ID_PREFIX;
- target[position++] = recordId;
- } else {
- recordId = structures.nextId++;
- if (!recordId) {
- recordId = 0;
- structures.nextId = 1;
- }
- if (recordId >= MAX_STRUCTURES) {// cycle back around
- structures.nextId = (recordId = maxSharedStructures) + 1;
- }
- transition[RECORD_SYMBOL] = recordId;
- structures[recordId] = keys;
- if (sharedStructures && sharedStructures.length <= maxSharedStructures) {
- target[position++] = 0xd9; // tag two byte
- target[position++] = RECORD_STARTING_ID_PREFIX;
- target[position++] = recordId; // tag number
- hasSharedUpdate = true;
- } else {
- target[position++] = 0xd8;
- target[position++] = RECORD_STARTING_ID_PREFIX;
- if (newTransitions)
- transitionsCount += serializationsSinceTransitionRebuild * newTransitions;
- // record the removal of the id, we can maintain our shared structure
- if (recordIdsToRemove.length >= MAX_STRUCTURES - maxSharedStructures)
- recordIdsToRemove.shift()[RECORD_SYMBOL] = undefined; // we are cycling back through, and have to remove old ones
- recordIdsToRemove.push(transition);
- if (length < 0x16)
- target[position++] = 0x82 + length; // array header, length of values + 2
- else
- writeArrayHeader(length + 2);
- encode(keys);
- target[position++] = 0x19; // uint16
- target[position++] = RECORD_STARTING_ID_PREFIX;
- target[position++] = recordId;
- // now write the values
- for (let i =0; i < length; i++)
- encode(object[keys[i]]);
- return
- }
- }
- if (length < 0x18) { // write the array header
- target[position++] = 0x80 | length;
- } else {
- writeArrayHeader(length);
- }
- for (let i =0; i < length; i++)
- encode(object[keys[i]]);
- };
- const makeRoom = (end) => {
- let newSize;
- if (end > 0x1000000) {
- // special handling for really large buffers
- if ((end - start) > MAX_BUFFER_SIZE)
- throw new Error('Encoded buffer would be larger than maximum buffer size')
- newSize = Math.min(MAX_BUFFER_SIZE,
- Math.round(Math.max((end - start) * (end > 0x4000000 ? 1.25 : 2), 0x1000000) / 0x1000) * 0x1000);
- } else // faster handling for smaller buffers
- newSize = ((Math.max((end - start) << 2, target.length - 1) >> 12) + 1) << 12;
- let newBuffer = new ByteArrayAllocate(newSize);
- targetView = new DataView(newBuffer.buffer, 0, newSize);
- if (target.copy)
- target.copy(newBuffer, 0, start, end);
- else
- newBuffer.set(target.slice(start, end));
- position -= start;
- start = 0;
- safeEnd = newBuffer.length - 10;
- return target = newBuffer
- };
- }
- useBuffer(buffer) {
- // this means we are finished using our own buffer and we can write over it safely
- target = buffer;
- targetView = new DataView(target.buffer, target.byteOffset, target.byteLength);
- position = 0;
- }
- }
-
- function writeArrayHeader(length) {
- if (length < 0x100) {
- target[position++] = 0x98;
- target[position++] = length;
- } else if (length < 0x10000) {
- target[position++] = 0x99;
- target[position++] = length >> 8;
- target[position++] = length & 0xff;
- } else {
- target[position++] = 0x9a;
- targetView.setUint32(position, length);
- position += 4;
- }
- }
-
- extensionClasses = [ Date, Set, Error, RegExp, ArrayBuffer, ByteArray,
- Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, BigUint64Array, Int8Array, Int16Array, Int32Array, BigInt64Array,
- Float32Array, Float64Array];
-
- //Object.getPrototypeOf(Uint8Array.prototype).constructor /*TypedArray*/
- extensions = [{
- tag: 1,
- encode(date, encode) {
- let seconds = date.getTime() / 1000;
- if ((this.useTimestamp32 || date.getMilliseconds() === 0) && seconds >= 0 && seconds < 0x100000000) {
- // Timestamp 32
- target[position++] = 0x1a;
- targetView.setUint32(position, seconds);
- position += 4;
- } else {
- // Timestamp float64
- target[position++] = 0xfb;
- targetView.setFloat64(position, seconds);
- position += 8;
- }
- }
- }, {
- tag: 258, // https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md
- encode(set, encode) {
- let array = Array.from(set);
- encode(array);
- }
- }, {
- tag: 27, // http://cbor.schmorp.de/generic-object
- encode(error, encode) {
- encode([ error.name, error.message ]);
- }
- }, {
- tag: 27, // http://cbor.schmorp.de/generic-object
- encode(regex, encode) {
- encode([ 'RegExp', regex.source, regex.flags ]);
- }
- }, {
- encode(arrayBuffer, encode, makeRoom) {
- writeBuffer(arrayBuffer, makeRoom);
- }
- }, {
- encode(arrayBuffer, encode, makeRoom) {
- writeBuffer(arrayBuffer, makeRoom);
- }
- }, typedArrayEncoder(64),
- typedArrayEncoder(68),
- typedArrayEncoder(69),
- typedArrayEncoder(70),
- typedArrayEncoder(71),
- typedArrayEncoder(72),
- typedArrayEncoder(77),
- typedArrayEncoder(78),
- typedArrayEncoder(79),
- typedArrayEncoder(81),
- typedArrayEncoder(82)];
-
- function typedArrayEncoder(tag) {
- return {
- tag: tag,
- encode: function writeExtBuffer(typedArray, encode) {
- let length = typedArray.byteLength;
- let offset = typedArray.byteOffset || 0;
- let buffer = typedArray.buffer || typedArray;
- encode(hasNodeBuffer ? Buffer.from(buffer, offset, length) :
- new Uint8Array(buffer, offset, length));
- }
- }
- }
- function writeBuffer(buffer, makeRoom) {
- let length = buffer.byteLength;
- if (length < 0x18) {
- target[position++] = 0x40 + length;
- } else if (length < 0x100) {
- target[position++] = 0x58;
- target[position++] = length;
- } else if (length < 0x10000) {
- target[position++] = 0x59;
- target[position++] = length >> 8;
- target[position++] = length & 0xff;
- } else {
- target[position++] = 0x5a;
- targetView.setUint32(position, length);
- position += 4;
- }
- if (position + length >= target.length) {
- makeRoom(position + length);
- }
- target.set(buffer, position);
- position += length;
- }
-
- function insertIds(serialized, idsToInsert) {
- // insert the ids that need to be referenced for structured clones
- let nextId;
- let distanceToMove = idsToInsert.length * 8;
- let lastEnd = serialized.length - distanceToMove;
- idsToInsert.sort((a, b) => a.offset > b.offset ? 1 : -1);
- while (nextId = idsToInsert.pop()) {
- let offset = nextId.offset;
- let id = nextId.id;
- serialized.copyWithin(offset + distanceToMove, offset, lastEnd);
- distanceToMove -= 8;
- let position = offset + distanceToMove;
- serialized[position++] = 0xd9;
- serialized[position++] = 40009 >> 8;
- serialized[position++] = 40009 & 0xff;
- serialized[position++] = 0x1a; // uint32
- serialized[position++] = id >> 24;
- serialized[position++] = (id >> 16) & 0xff;
- serialized[position++] = (id >> 8) & 0xff;
- serialized[position++] = id & 0xff;
- lastEnd = offset;
- }
- return serialized
- }
-
- function addExtension(extension) {
- if (extension.Class) {
- if (!extension.encode)
- throw new Error('Extension has no encode function')
- extensionClasses.unshift(extension.Class);
- extensions.unshift(extension);
- }
- addExtension$1(extension);
- }
- let defaultEncoder = new Encoder({ useRecords: false });
+ function addExtension(extension) {
+ if (extension.Class) {
+ if (!extension.encode)
+ throw new Error('Extension has no encode function')
+ extensionClasses.unshift(extension.Class);
+ extensions.unshift(extension);
+ }
+ addExtension$1(extension);
+ }
+ let defaultEncoder = new Encoder({ useRecords: false });
defaultEncoder.encode;
+ defaultEncoder.encodeAsIterable;
+ defaultEncoder.encodeAsAsyncIterable;
+ const REUSE_BUFFER_MODE = 512;
+ const RESET_BUFFER_MODE = 1024;
+ const THROW_ON_ITERABLE = 2048;
var lzjbPack = {};
@@ -4979,12 +5775,12 @@
*
*
*
- * LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript
+ * LIPS is Pretty Simple - Scheme based powerful LISP in JavaScript
*
* Copyright (c) 2018-2021 Jakub T. Jankiewicz
* Released under the MIT license
*
- * includes:
+ * Includes:
*
* ucs2decode function from Punycode v 2.1.1 by Mathias Bynens MIT License
*
@@ -5003,7 +5799,7 @@
* The rationalize algorithm is by Per M.A. Bothner, Alan Bawden and Marc Feeley.
* source: Kawa, C-Gambit
*
- * Build time: Mon, 15 Nov 2021 19:33:52 +0000
+ * Build time: Wed, 22 Nov 2023 13:53:23 +0000
*/
var _excluded = ["token"],
_excluded2 = ["stderr", "stdin", "stdout", "command_line"];
@@ -5018,9 +5814,14 @@
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
+
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
+
+ function _asyncIterator(iterable) { var method, async, sync, retry = 2; for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) { if (async && null != (method = iterable[async])) return method.call(iterable); if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
+
+ function AsyncFromSyncIterator(s) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var done = r.done; return Promise.resolve(r.value).then(function (value) { return { value: value, done: done }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(value) { var ret = this.s["return"]; return void 0 === ret ? Promise.resolve({ value: value, done: !0 }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); }, "throw": function _throw(value) { var thr = this.s["return"]; return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(s); }
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var root = typeof global !== 'undefined' ? global : self;
if (!root.fetch) {
@@ -5140,7 +5941,7 @@
/* eslint-enable */
/* eslint-disable max-len */
- // functions generate regexes to match number rational, integer, complex, complex+ratioanl
+ // functions generate regexes to match number rational, integer, complex, complex+rational
function num_mnemicic_re(mnemonic) {
@@ -5271,7 +6072,7 @@
var character_symbols = Object.keys(characters).join('|');
var char_sre_re = "#\\\\(?:x[0-9a-f]+|".concat(character_symbols, "|[\\s\\S])");
- var char_re = new RegExp("^".concat(char_sre_re, "$"), 'i'); // complex with (int) (float) (rational)
+ var char_re = new RegExp("^".concat(char_sre_re, "$"), 'i'); // Complex with (int) (float) (rational)
function make_num_stre(fn) {
var ranges = [['o', '[0-7]'], ['x', '[0-9a-fA-F]'], ['b', '[01]'], ['d', '[0-9]'], ['', '[0-9]']]; // float exception that don't accept mnemonics
@@ -5510,7 +6311,7 @@
if (is_int(value) && parse.number.match(/e\+?[0-9]/i)) {
return LNumber(value);
- } // calculate big int and big fration by hand - it don't fit into JS float
+ } // calculate big int and big fraction by hand - it don't fit into JS float
var _parse_big_int = parse_big_int(parse.number),
@@ -5556,7 +6357,8 @@
try {
return LString(JSON.parse(string));
} catch (e) {
- throw new Error('Invalid string literal');
+ var msg = e.message.replace(/in JSON /, '').replace(/.*Error: /, '');
+ throw new Error("Invalid string literal: ".concat(msg));
}
} // ----------------------------------------------------------------------
@@ -5819,7 +6621,7 @@
return tokens;
} // ----------------------------------------------------------------------
- // detect if object is ES6 Symbol that work with polyfills
+ // Detect if object is ES6 Symbol that work with polyfills
// ----------------------------------------------------------------------
@@ -5948,7 +6750,7 @@
return with_props(count, Symbol("#:g".concat(count)));
};
}(); // ----------------------------------------------------------------------
- // class used to escape promises feature #54
+ // Class used to escape promises: feature #54
// ----------------------------------------------------------------------
@@ -6089,13 +6891,13 @@
SPLICE: Symbol["for"]('splice'),
SYMBOL: Symbol["for"]('symbol'),
names: function names() {
- return Object.keys(this._specials);
+ return Object.keys(this.__list__);
},
type: function type(name) {
return this.get(name).type;
},
get: function get(name) {
- return this._specials[name];
+ return this.__list__[name];
},
// events are used in Lexer dynamic rules
off: function off(name) {
@@ -6108,9 +6910,9 @@
return _this2.off(name, fn);
});
} else if (fn === null) {
- delete this._events[name];
+ delete this.__events__[name];
} else {
- this._events = this._events.filter(function (test) {
+ this.__events__ = this.__events__.filter(function (test) {
return test !== fn;
});
}
@@ -6122,10 +6924,10 @@
name.forEach(function (name) {
return _this3.on(name, fn);
});
- } else if (!this._events[name]) {
- this._events[name] = [fn];
+ } else if (!this.__events__[name]) {
+ this.__events__[name] = [fn];
} else {
- this._events[name].push(fn);
+ this.__events__[name].push(fn);
}
},
trigger: function trigger(name) {
@@ -6133,26 +6935,26 @@
args[_key2 - 1] = arguments[_key2];
}
- if (this._events[name]) {
- this._events[name].forEach(function (fn) {
+ if (this.__events__[name]) {
+ this.__events__[name].forEach(function (fn) {
return fn.apply(void 0, args);
});
}
},
remove: function remove(name) {
this.trigger('remove');
- delete this._specials[name];
+ delete this.__list__[name];
},
append: function append(name, value, type) {
this.trigger('append');
- this._specials[name] = {
+ this.__list__[name] = {
seq: name,
symbol: value,
type: type
};
},
- _events: {},
- _specials: {}
+ __events__: {},
+ __list__: {}
};
function is_special(token) {
@@ -6160,7 +6962,7 @@
}
function is_builtin(token) {
- return specials.builtin.includes(token);
+ return specials.__builtins__.includes(token);
}
function is_literal(special) {
@@ -6169,11 +6971,13 @@
var defined_specials = [["'", new LSymbol('quote'), specials.LITERAL], ['`', new LSymbol('quasiquote'), specials.LITERAL], [',@', new LSymbol('unquote-splicing'), specials.LITERAL], [',', new LSymbol('unquote'), specials.LITERAL], ["'>", new LSymbol('quote-promise'), specials.LITERAL]];
- Object.defineProperty(specials, 'builtin', {
+ var builtins = defined_specials.map(function (arr) {
+ return arr[0];
+ });
+ Object.freeze(builtins);
+ Object.defineProperty(specials, '__builtins__', {
writable: false,
- value: defined_specials.map(function (arr) {
- return arr[0];
- })
+ value: builtins
});
defined_specials.forEach(function (_ref5) {
var _ref6 = _slicedToArray(_ref5, 3),
@@ -6384,7 +7188,7 @@
state = _rule[3];
if (rule.length !== 5) {
- throw new Error("Lexer: Invald rule of length ".concat(rule.length));
+ throw new Error("Lexer: Invalid rule of length ".concat(rule.length));
}
if (!_char4.match(re)) {
@@ -6424,7 +7228,7 @@
var newline = this._newline;
if (this._state === null) {
- // keep beging of newline to calculate col
+ // keep beginning of the newline to calculate col
// we don't want to check inside the token (e.g. strings)
this._newline = i + 1;
}
@@ -6434,7 +7238,7 @@
this._col = this._i - newline;
return true;
}
- } // skip leadning spaces
+ } // skip leading spaces
if (start && this._state === null && _char5.match(/\s/)) {
@@ -6466,7 +7270,7 @@
"char": _char5,
next_char: next_char
})) {
- // change state to null is end of the token
+ // change state to null if end of the token
var next_state = rule[rule.length - 1];
this._state = next_state;
@@ -6509,7 +7313,7 @@
var rules = Lexer.literal_rule(string, symbol, Lexer.boundary, /\S/);
return rules.concat([[/\S/, /\S/, Lexer.boundary, null, null], [/\S/, /\S/, null, null, Lexer.symbol], [/\S/, null, Lexer.boundary, Lexer.symbol, null]]);
}; // ----------------------------------------------------------------------
- // state rule for literal symbol
+ // State rule for literal symbol
// ----------------------------------------------------------------------
@@ -6552,9 +7356,11 @@
Lexer.string = Symbol["for"]('string');
+ Lexer.string_escape = Symbol["for"]('string_escape');
Lexer.symbol = Symbol["for"]('symbol');
Lexer.comment = Symbol["for"]('comment');
Lexer.regex = Symbol["for"]('regex');
+ Lexer.regex_init = Symbol["for"]('regex_init');
Lexer.regex_class = Symbol["for"]('regex_class');
Lexer.character = Symbol["for"]('character');
Lexer.bracket = Symbol["for"]('bracket');
@@ -6569,11 +7375,11 @@
Lexer._rules = [// char_re prev_re next_re from_state to_state
// null as to_state mean that is single char token
// string
- [/"/, /^$|[^\\]/, null, null, Lexer.string], [/"/, /^$|[^\\]/, null, Lexer.string, null], // hash special symbols, lexer don't need to distingiush those
+ [/"/, null, null, Lexer.string, null], [/"/, null, null, null, Lexer.string], [/"/, null, null, Lexer.string_escape, Lexer.string], [/\\/, null, null, Lexer.string, Lexer.string_escape], [/./, /\\/, null, Lexer.string_escape, Lexer.string], // hash special symbols, lexer don't need to distinguish those
// we only care if it's not pick up by vectors literals
[/#/, null, /[bdxoeitf]/i, null, Lexer.symbol], // characters
[/#/, null, /\\/, null, Lexer.character], [/\\/, /#/, /\s/, Lexer.character, Lexer.character], [/\\/, /#/, /[()[\]]/, Lexer.character, Lexer.character], [/\s/, /\\/, null, Lexer.character, null], [/\S/, null, Lexer.boundary, Lexer.character, null], // regex
- [/#/, Lexer.boundary, /\//, null, Lexer.regex], [/[ \t]/, null, null, Lexer.regex, Lexer.regex], [/\[/, null, null, Lexer.regex, Lexer.regex_class], [/\]/, /[^\\]/, null, Lexer.regex_class, Lexer.regex], [/[()[\]]/, null, null, Lexer.regex, Lexer.regex], [/\//, /\\/, null, Lexer.regex, Lexer.regex], [/\//, /[^#]/, Lexer.boundary, Lexer.regex, null], [/[gimyus]/, /\//, Lexer.boundary, Lexer.regex, null], [/[gimyus]/, /\//, /[gimyus]/, Lexer.regex, Lexer.regex], [/[gimyus]/, /[gimyus]/, Lexer.boundary, Lexer.regex, null], // comment
+ [/#/, Lexer.boundary, /\//, null, Lexer.regex_init], [/./, /\//, null, Lexer.regex_init, Lexer.regex], [/[ \t]/, null, null, Lexer.regex, Lexer.regex], [/\[/, null, null, Lexer.regex, Lexer.regex_class], [/\]/, /[^\\]/, null, Lexer.regex_class, Lexer.regex], [/[()[\]]/, null, null, Lexer.regex, Lexer.regex], [/\//, /\\/, null, Lexer.regex, Lexer.regex], [/\//, /[^#]/, Lexer.boundary, Lexer.regex, null], [/[gimyus]/, /\//, Lexer.boundary, Lexer.regex, null], [/[gimyus]/, /\//, /[gimyus]/, Lexer.regex, Lexer.regex], [/[gimyus]/, /[gimyus]/, Lexer.boundary, Lexer.regex, null], // comment
[/;/, /^$|[^#]/, null, null, Lexer.comment], [/[\s\S]/, null, /\n/, Lexer.comment, null], [/\s/, null, null, Lexer.comment, Lexer.comment], // block comment
[/#/, null, /\|/, null, Lexer.b_comment], [/\s/, null, null, Lexer.b_comment, Lexer.b_comment], [/#/, /\|/, null, Lexer.b_comment, null], // inline commentss
[/#/, null, /;/, null, Lexer.i_comment], [/;/, /#/, null, Lexer.i_comment, null], // datum label
@@ -6586,8 +7392,8 @@
// ----------------------------------------------------------------------
Lexer._symbol_rules = [[/\S/, Lexer.boundary, Lexer.boundary, null, null], [/\S/, Lexer.boundary, null, null, Lexer.symbol], [/\S/, null, Lexer.boundary, null, null], [/\S/, null, null, null, Lexer.symbol], [/\S/, null, Lexer.boundary, Lexer.symbol, null]]; // ----------------------------------------------------------------------
- // :: dynamic getter or Lexer state rules, parser use this
- // :: so in fact user code can modify lexer using syntax extensions
+ // :: Dynamic getter or Lexer state rules, parser uses this
+ // :: so user code can modify Lexer using syntax extensions
// ----------------------------------------------------------------------
Lexer._cache = {
@@ -6693,72 +7499,72 @@
}, {
key: "peek",
value: function () {
- var _peek = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
+ var _peek = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
var token;
- return regenerator.wrap(function _callee$(_context2) {
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
- switch (_context2.prev = _context2.next) {
+ switch (_context.prev = _context.next) {
case 0:
token = this.__lexer__.peek(true);
if (!(token === eof)) {
- _context2.next = 4;
+ _context.next = 4;
break;
}
- return _context2.abrupt("return", eof);
+ return _context.abrupt("return", eof);
case 4:
if (!this.is_comment(token.token)) {
- _context2.next = 7;
+ _context.next = 7;
break;
}
this.skip();
- return _context2.abrupt("continue", 0);
+ return _context.abrupt("continue", 0);
case 7:
if (!(token.token === '#;')) {
- _context2.next = 14;
+ _context.next = 14;
break;
}
this.skip();
if (!(this.__lexer__.peek() === eof)) {
- _context2.next = 11;
+ _context.next = 11;
break;
}
throw new Error('Lexer: syntax error eof found after comment');
case 11:
- _context2.next = 13;
+ _context.next = 13;
return this._read_object();
case 13:
- return _context2.abrupt("continue", 0);
+ return _context.abrupt("continue", 0);
case 14:
- return _context2.abrupt("break", 17);
+ return _context.abrupt("break", 17);
case 17:
token = this._formatter(token);
if (!this._meta) {
- _context2.next = 20;
+ _context.next = 20;
break;
}
- return _context2.abrupt("return", token);
+ return _context.abrupt("return", token);
case 20:
- return _context2.abrupt("return", token.token);
+ return _context.abrupt("return", token.token);
case 21:
case "end":
- return _context2.stop();
+ return _context.stop();
}
}
}, _callee, this);
@@ -6783,23 +7589,23 @@
}, {
key: "read",
value: function () {
- var _read = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
+ var _read = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
var token;
- return regenerator.wrap(function _callee2$(_context3) {
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
- switch (_context3.prev = _context3.next) {
+ switch (_context2.prev = _context2.next) {
case 0:
- _context3.next = 2;
+ _context2.next = 2;
return this.peek();
case 2:
- token = _context3.sent;
+ token = _context2.sent;
this.skip();
- return _context3.abrupt("return", token);
+ return _context2.abrupt("return", token);
case 5:
case "end":
- return _context3.stop();
+ return _context2.stop();
}
}
}, _callee2, this);
@@ -6848,62 +7654,62 @@
}, {
key: "read_list",
value: function () {
- var _read_list = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3() {
+ var _read_list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
var head, prev, token, cur;
- return regenerator.wrap(function _callee3$(_context4) {
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
- switch (_context4.prev = _context4.next) {
+ switch (_context3.prev = _context3.next) {
case 0:
head = _nil, prev = head;
case 1:
- _context4.next = 4;
+ _context3.next = 4;
return this.peek();
case 4:
- token = _context4.sent;
+ token = _context3.sent;
if (!(token === eof)) {
- _context4.next = 7;
+ _context3.next = 7;
break;
}
- return _context4.abrupt("break", 27);
+ return _context3.abrupt("break", 27);
case 7:
if (!this.is_close(token)) {
- _context4.next = 10;
+ _context3.next = 10;
break;
}
this.skip();
- return _context4.abrupt("break", 27);
+ return _context3.abrupt("break", 27);
case 10:
if (!(token === '.' && head !== _nil)) {
- _context4.next = 17;
+ _context3.next = 17;
break;
}
this.skip();
- _context4.next = 14;
+ _context3.next = 14;
return this._read_object();
case 14:
- prev.cdr = _context4.sent;
- _context4.next = 25;
+ prev.cdr = _context3.sent;
+ _context3.next = 25;
break;
case 17:
- _context4.t0 = Pair;
- _context4.next = 20;
+ _context3.t0 = Pair;
+ _context3.next = 20;
return this._read_object();
case 20:
- _context4.t1 = _context4.sent;
- _context4.t2 = _nil;
- cur = new _context4.t0(_context4.t1, _context4.t2);
+ _context3.t1 = _context3.sent;
+ _context3.t2 = _nil;
+ cur = new _context3.t0(_context3.t1, _context3.t2);
if (head === _nil) {
head = cur;
@@ -6914,15 +7720,15 @@
prev = cur;
case 25:
- _context4.next = 1;
+ _context3.next = 1;
break;
case 27:
- return _context4.abrupt("return", head);
+ return _context3.abrupt("return", head);
case 28:
case "end":
- return _context4.stop();
+ return _context3.stop();
}
}
}, _callee3, this);
@@ -6937,31 +7743,31 @@
}, {
key: "read_value",
value: function () {
- var _read_value = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4() {
+ var _read_value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
var token;
- return regenerator.wrap(function _callee4$(_context5) {
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
while (1) {
- switch (_context5.prev = _context5.next) {
+ switch (_context4.prev = _context4.next) {
case 0:
- _context5.next = 2;
+ _context4.next = 2;
return this.read();
case 2:
- token = _context5.sent;
+ token = _context4.sent;
if (!(token === eof)) {
- _context5.next = 5;
+ _context4.next = 5;
break;
}
throw new Error('Parser: Expected token eof found');
case 5:
- return _context5.abrupt("return", parse_argument(token));
+ return _context4.abrupt("return", parse_argument(token));
case 6:
case "end":
- return _context5.stop();
+ return _context4.stop();
}
}
}, _callee4, this);
@@ -6992,36 +7798,36 @@
}, {
key: "read_object",
value: function () {
- var _read_object2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee5() {
+ var _read_object2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
var object;
- return regenerator.wrap(function _callee5$(_context6) {
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
while (1) {
- switch (_context6.prev = _context6.next) {
+ switch (_context5.prev = _context5.next) {
case 0:
this.reset();
- _context6.next = 3;
+ _context5.next = 3;
return this._read_object();
case 3:
- object = _context6.sent;
+ object = _context5.sent;
if (object instanceof DatumReference) {
object = object.valueOf();
}
if (!this._refs.length) {
- _context6.next = 7;
+ _context5.next = 7;
break;
}
- return _context6.abrupt("return", this._resolve_object(object));
+ return _context5.abrupt("return", this._resolve_object(object));
case 7:
- return _context6.abrupt("return", object);
+ return _context5.abrupt("return", object);
case 8:
case "end":
- return _context6.stop();
+ return _context5.stop();
}
}
}, _callee5, this);
@@ -7034,8 +7840,8 @@
return read_object;
}()
}, {
- key: "ballanced",
- value: function ballanced() {
+ key: "balanced",
+ value: function balanced() {
return this._state.parentheses === 0;
}
}, {
@@ -7050,26 +7856,26 @@
}, {
key: "_resolve_object",
value: function () {
- var _resolve_object2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee6(object) {
+ var _resolve_object2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(object) {
var _this5 = this;
var result;
- return regenerator.wrap(function _callee6$(_context7) {
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
while (1) {
- switch (_context7.prev = _context7.next) {
+ switch (_context6.prev = _context6.next) {
case 0:
if (!Array.isArray(object)) {
- _context7.next = 2;
+ _context6.next = 2;
break;
}
- return _context7.abrupt("return", object.map(function (item) {
+ return _context6.abrupt("return", object.map(function (item) {
return _this5._resolve_object(item);
}));
case 2:
if (!is_plain_object(object)) {
- _context7.next = 6;
+ _context6.next = 6;
break;
}
@@ -7077,22 +7883,22 @@
Object.keys(object).forEach(function (key) {
result[key] = _this5._resolve_object(object[key]);
});
- return _context7.abrupt("return", result);
+ return _context6.abrupt("return", result);
case 6:
if (!(object instanceof Pair)) {
- _context7.next = 8;
+ _context6.next = 8;
break;
}
- return _context7.abrupt("return", this._resolve_pair(object));
+ return _context6.abrupt("return", this._resolve_pair(object));
case 8:
- return _context7.abrupt("return", object);
+ return _context6.abrupt("return", object);
case 9:
case "end":
- return _context7.stop();
+ return _context6.stop();
}
}
}, _callee6, this);
@@ -7107,27 +7913,27 @@
}, {
key: "_resolve_pair",
value: function () {
- var _resolve_pair2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee7(pair) {
- return regenerator.wrap(function _callee7$(_context8) {
+ var _resolve_pair2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(pair) {
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
while (1) {
- switch (_context8.prev = _context8.next) {
+ switch (_context7.prev = _context7.next) {
case 0:
if (!(pair instanceof Pair)) {
- _context8.next = 15;
+ _context7.next = 15;
break;
}
if (!(pair.car instanceof DatumReference)) {
- _context8.next = 7;
+ _context7.next = 7;
break;
}
- _context8.next = 4;
+ _context7.next = 4;
return pair.car.valueOf();
case 4:
- pair.car = _context8.sent;
- _context8.next = 8;
+ pair.car = _context7.sent;
+ _context7.next = 8;
break;
case 7:
@@ -7135,27 +7941,27 @@
case 8:
if (!(pair.cdr instanceof DatumReference)) {
- _context8.next = 14;
+ _context7.next = 14;
break;
}
- _context8.next = 11;
+ _context7.next = 11;
return pair.cdr.valueOf();
case 11:
- pair.cdr = _context8.sent;
- _context8.next = 15;
+ pair.cdr = _context7.sent;
+ _context7.next = 15;
break;
case 14:
this._resolve_pair(pair.cdr);
case 15:
- return _context8.abrupt("return", pair);
+ return _context7.abrupt("return", pair);
case 16:
case "end":
- return _context8.stop();
+ return _context7.stop();
}
}
}, _callee7, this);
@@ -7170,164 +7976,172 @@
}, {
key: "_read_object",
value: function () {
- var _read_object3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee8() {
- var token, special, bultin, expr, object, extension, result, ref, ref_label;
- return regenerator.wrap(function _callee8$(_context9) {
+ var _read_object3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
+ var token, special, builtin, expr, object, extension, result, ref, ref_label;
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
while (1) {
- switch (_context9.prev = _context9.next) {
+ switch (_context8.prev = _context8.next) {
case 0:
- _context9.next = 2;
+ _context8.next = 2;
return this.peek();
case 2:
- token = _context9.sent;
+ token = _context8.sent;
if (!(token === eof)) {
- _context9.next = 5;
+ _context8.next = 5;
break;
}
- return _context9.abrupt("return", token);
+ return _context8.abrupt("return", token);
case 5:
if (!is_special(token)) {
- _context9.next = 35;
+ _context8.next = 39;
break;
}
- // bultin parser extensions are mapping short symbol to longer symbol
- // that can be function or macro, parser don't care
- // if it's not bultin then the extension can be macro or function
- // FUNCTION: when it's used it get arguments like FEXPR and
- // result is returned by parser as is
- // MACRO: if macros are used they are evaluated in place and
- // result is returned by parser but they are quoted
+ // Built-in parser extensions are mapping short symbols to longer symbols
+ // that can be function or macro. Parser doesn't care
+ // if it's not built-in and the extension can be macro or function.
+ // FUNCTION: when it's used, it gets arguments like FEXPR and the
+ // result is returned by parser as is the macro.
+ // MACRO: if macro is used, then it is evaluated in place and the
+ // result is returned by parser and it is quoted.
special = specials.get(token);
- bultin = is_builtin(token);
+ builtin = is_builtin(token);
this.skip();
- _context9.next = 11;
+ _context8.next = 11;
return this._read_object();
case 11:
- object = _context9.sent;
+ object = _context8.sent;
- if (bultin) {
- _context9.next = 22;
+ if (builtin) {
+ _context8.next = 26;
break;
}
extension = this.__env__.get(special.symbol);
if (!(typeof extension === 'function')) {
- _context9.next = 22;
+ _context8.next = 26;
break;
}
if (!is_literal(token)) {
- _context9.next = 19;
+ _context8.next = 19;
break;
}
- return _context9.abrupt("return", extension.call(this.__env__, object));
+ return _context8.abrupt("return", extension.call(this.__env__, object));
case 19:
+ if (!(object === _nil)) {
+ _context8.next = 23;
+ break;
+ }
+
+ return _context8.abrupt("return", extension.apply(this.__env__));
+
+ case 23:
if (!(object instanceof Pair)) {
- _context9.next = 21;
+ _context8.next = 25;
break;
}
- return _context9.abrupt("return", extension.apply(this.__env__, object.to_array(false)));
+ return _context8.abrupt("return", extension.apply(this.__env__, object.to_array(false)));
- case 21:
+ case 25:
throw new Error('Parse Error: Invalid parser extension ' + "invocation ".concat(special.symbol));
- case 22:
+ case 26:
if (is_literal(token)) {
expr = new Pair(special.symbol, new Pair(object, _nil));
} else {
expr = new Pair(special.symbol, object);
- } // builtin parser extensions just expand into lists like 'x ==> (quote x)
+ } // Built-in parser extensions just expand into lists like 'x ==> (quote x)
- if (!bultin) {
- _context9.next = 25;
+ if (!builtin) {
+ _context8.next = 29;
break;
}
- return _context9.abrupt("return", expr);
+ return _context8.abrupt("return", expr);
- case 25:
+ case 29:
if (!(extension instanceof Macro)) {
- _context9.next = 34;
+ _context8.next = 38;
break;
}
- _context9.next = 28;
+ _context8.next = 32;
return this.evaluate(expr);
- case 28:
- result = _context9.sent;
+ case 32:
+ result = _context8.sent;
if (!(result instanceof Pair || result instanceof LSymbol)) {
- _context9.next = 31;
+ _context8.next = 35;
break;
}
- return _context9.abrupt("return", Pair.fromArray([LSymbol('quote'), result]));
+ return _context8.abrupt("return", Pair.fromArray([LSymbol('quote'), result]));
- case 31:
- return _context9.abrupt("return", result);
+ case 35:
+ return _context8.abrupt("return", result);
- case 34:
- throw new Error('Parse Error: invlid parser extension: ' + special.symbol);
+ case 38:
+ throw new Error('Parse Error: invalid parser extension: ' + special.symbol);
- case 35:
+ case 39:
ref = this.match_datum_ref(token);
if (!(ref !== null)) {
- _context9.next = 41;
+ _context8.next = 45;
break;
}
this.skip();
if (!this._refs[ref]) {
- _context9.next = 40;
+ _context8.next = 44;
break;
}
- return _context9.abrupt("return", new DatumReference(ref, this._refs[ref]));
+ return _context8.abrupt("return", new DatumReference(ref, this._refs[ref]));
- case 40:
+ case 44:
throw new Error("Parse Error: invalid datum label #".concat(ref, "#"));
- case 41:
+ case 45:
ref_label = this.match_datum_label(token);
if (!(ref_label !== null)) {
- _context9.next = 48;
+ _context8.next = 52;
break;
}
this.skip();
this._refs[ref_label] = this._read_object();
- return _context9.abrupt("return", this._refs[ref_label]);
+ return _context8.abrupt("return", this._refs[ref_label]);
- case 48:
+ case 52:
if (!this.is_open(token)) {
- _context9.next = 53;
+ _context8.next = 57;
break;
}
this.skip();
- return _context9.abrupt("return", this.read_list());
+ return _context8.abrupt("return", this.read_list());
- case 53:
- return _context9.abrupt("return", this.read_value());
+ case 57:
+ return _context8.abrupt("return", this.read_value());
- case 54:
+ case 58:
case "end":
- return _context9.stop();
+ return _context8.stop();
}
}
}, _callee8, this);
@@ -7343,7 +8157,7 @@
return Parser;
}(); // ----------------------------------------------------------------------
- // :: parser helper that allow to handle circular list structures
+ // :: Parser helper that handles circular list structures
// :: using datum labels
// ----------------------------------------------------------------------
@@ -7365,11 +8179,11 @@
return DatumReference;
}(); // ----------------------------------------------------------------------
- // :: tokens are the array of strings from tokenizer
- // :: the return value is array of lisp code created out of Pair class
+ // :: Tokens are the array of strings from tokenizer
+ // :: the return value is an array of lips code created out of Pair class.
// :: env is needed for parser extensions that will invoke the function
// :: or macro assigned to symbol, this function is async because
- // :: it evaluate the code, from parser extensions, that may return promise
+ // :: it evaluates the code, from parser extensions, that may return a promise.
// ----------------------------------------------------------------------
@@ -7379,11 +8193,11 @@
function _parse() {
- _parse = _wrapAsyncGenerator( /*#__PURE__*/regenerator.mark(function _callee9(arg, env) {
+ _parse = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(arg, env) {
var parser, expr;
- return regenerator.wrap(function _callee9$(_context10) {
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
while (1) {
- switch (_context10.prev = _context10.next) {
+ switch (_context9.prev = _context9.next) {
case 0:
if (!env) {
if (global_env) {
@@ -7401,34 +8215,34 @@
case 2:
- _context10.next = 5;
+ _context9.next = 5;
return _awaitAsyncGenerator(parser.read_object());
case 5:
- expr = _context10.sent;
+ expr = _context9.sent;
- if (!parser.ballanced()) {
+ if (!parser.balanced()) {
parser.ballancing_error(expr);
}
if (!(expr === eof)) {
- _context10.next = 9;
+ _context9.next = 9;
break;
}
- return _context10.abrupt("break", 13);
+ return _context9.abrupt("break", 13);
case 9:
- _context10.next = 11;
+ _context9.next = 11;
return expr;
case 11:
- _context10.next = 2;
+ _context9.next = 2;
break;
case 13:
case "end":
- return _context10.stop();
+ return _context9.stop();
}
}
}, _callee9);
@@ -7530,88 +8344,95 @@
// ----------------------------------------------------------------------
- function uniterate_async(object) {
- var result, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, item;
+ function uniterate_async(_x5) {
+ return _uniterate_async.apply(this, arguments);
+ } // ----------------------------------------------------------------------
+ // :: Function that return matcher function that match string against string
+ // ----------------------------------------------------------------------
- return regenerator.async(function uniterate_async$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- result = [];
- _iteratorAbruptCompletion = false;
- _didIteratorError = false;
- _context.prev = 3;
- _iterator = _asyncIterator(object);
-
- case 5:
- _context.next = 7;
- return regenerator.awrap(_iterator.next());
-
- case 7:
- if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
- _context.next = 13;
- break;
- }
- item = _step.value;
- result.push(item);
+ function _uniterate_async() {
+ _uniterate_async = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(object) {
+ var result, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, item;
- case 10:
- _iteratorAbruptCompletion = false;
- _context.next = 5;
- break;
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
+ while (1) {
+ switch (_context22.prev = _context22.next) {
+ case 0:
+ result = [];
+ _iteratorAbruptCompletion = false;
+ _didIteratorError = false;
+ _context22.prev = 3;
+ _iterator = _asyncIterator(object);
- case 13:
- _context.next = 19;
- break;
+ case 5:
+ _context22.next = 7;
+ return _iterator.next();
- case 15:
- _context.prev = 15;
- _context.t0 = _context["catch"](3);
- _didIteratorError = true;
- _iteratorError = _context.t0;
+ case 7:
+ if (!(_iteratorAbruptCompletion = !(_step = _context22.sent).done)) {
+ _context22.next = 13;
+ break;
+ }
- case 19:
- _context.prev = 19;
- _context.prev = 20;
+ item = _step.value;
+ result.push(item);
- if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
- _context.next = 24;
+ case 10:
+ _iteratorAbruptCompletion = false;
+ _context22.next = 5;
break;
- }
- _context.next = 24;
- return regenerator.awrap(_iterator["return"]());
+ case 13:
+ _context22.next = 19;
+ break;
- case 24:
- _context.prev = 24;
+ case 15:
+ _context22.prev = 15;
+ _context22.t0 = _context22["catch"](3);
+ _didIteratorError = true;
+ _iteratorError = _context22.t0;
- if (!_didIteratorError) {
- _context.next = 27;
- break;
- }
+ case 19:
+ _context22.prev = 19;
+ _context22.prev = 20;
- throw _iteratorError;
+ if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
+ _context22.next = 24;
+ break;
+ }
- case 27:
- return _context.finish(24);
+ _context22.next = 24;
+ return _iterator["return"]();
- case 28:
- return _context.finish(19);
+ case 24:
+ _context22.prev = 24;
- case 29:
- return _context.abrupt("return", result);
+ if (!_didIteratorError) {
+ _context22.next = 27;
+ break;
+ }
- case 30:
- case "end":
- return _context.stop();
- }
- }
- }, null, null, [[3, 15, 19, 29], [20,, 24, 28]], Promise);
- } // ----------------------------------------------------------------------
- // :: function that return mather function that match string against string
- // ----------------------------------------------------------------------
+ throw _iteratorError;
+
+ case 27:
+ return _context22.finish(24);
+
+ case 28:
+ return _context22.finish(19);
+ case 29:
+ return _context22.abrupt("return", result);
+
+ case 30:
+ case "end":
+ return _context22.stop();
+ }
+ }
+ }, _callee22, null, [[3, 15, 19, 29], [20,, 24, 28]]);
+ }));
+ return _uniterate_async.apply(this, arguments);
+ }
function matcher(name, arg) {
if (arg instanceof RegExp) {
@@ -7625,8 +8446,8 @@
throw new Error('Invalid matcher');
} // ----------------------------------------------------------------------
- // :: documentaton decorator to LIPS functions if lines starts with :
- // :: they are ignored (not trim) otherwise it trim so
+ // :: Documentation decorator to LIPS functions if lines starts with :
+ // :: they are ignored (not trimmed) otherwise it trims so
// :: so you can have indent in source code
// ----------------------------------------------------------------------
@@ -7698,7 +8519,7 @@
return tokens.slice(i + 1);
} // ----------------------------------------------------------------------
- // :: find number of spaces in line
+ // :: Find the number of spaces in line
// ----------------------------------------------------------------------
@@ -7725,11 +8546,11 @@
return 0;
} // ----------------------------------------------------------------------
- // :: token based pattern matching (used by formatter)
+ // :: Token based pattern matching (used by formatter)
// ----------------------------------------------------------------------
/*
- function nested_pattern(pattern) {
+ Function nested_pattern(pattern) {
return pattern instanceof Array ||
pattern instanceof Pattern;
}
@@ -7908,7 +8729,7 @@
}
};
Formatter.match = match; // ----------------------------------------------------------------------
- // :: return indent for next line
+ // :: Return indent for next line
// ----------------------------------------------------------------------
Formatter.prototype._options = function _options(options) {
@@ -7918,9 +8739,9 @@
return Object.assign({}, defaults);
}
- var exeptions = options && options.exceptions || {};
- var specials = exeptions.specials || [];
- var shift = exeptions.shift || {
+ var exceptions = options && options.exceptions || {};
+ var specials = exceptions.specials || [];
+ var shift = exceptions.shift || {
1: []
};
return _objectSpread(_objectSpread(_objectSpread({}, defaults), options), {}, {
@@ -8022,22 +8843,22 @@
return settings.offset + sexp[0].col + 1;
} else {
// search for token before S-Expression for case like #(10 or &(:x
- var exeption = -1;
+ var exception = -1;
if (before_sexpr) {
var shift = Formatter.exception_shift(before_sexpr.token, settings);
if (shift !== -1) {
- exeption = shift;
+ exception = shift;
}
}
- if (exeption === -1) {
- exeption = Formatter.exception_shift(sexp[1].token, settings);
+ if (exception === -1) {
+ exception = Formatter.exception_shift(sexp[1].token, settings);
}
- if (exeption !== -1) {
- return settings.offset + sexp[0].col + exeption;
+ if (exception !== -1) {
+ return settings.offset + sexp[0].col + exception;
} else if (sexp[0].line < sexp[1].line) {
return settings.offset + sexp[0].col + 1;
} else if (sexp.length > 3 && sexp[1].line === sexp[3].line) {
@@ -8081,8 +8902,8 @@
Ahead.prototype.match = function (string) {
return string.match(this.pattern);
}; // ----------------------------------------------------------------------
- // Pattern have any number of patterns that is match using OR operator
- // pattern is in form of array with regular expressions
+ // Pattern has any number of patterns that it matches using OR operator
+ // Pattern is in form of array with regular expressions
// ----------------------------------------------------------------------
@@ -8159,7 +8980,7 @@
return tokens.length - i - 1;
}
}
- }; // tokenize is part of the parser/lexer that split code into tokens and inclue
+ }; // Tokenize is part of the parser/lexer that split code into tokens and includes
// meta data like number of column or line
@@ -8239,7 +9060,7 @@
Formatter.prototype._spaces = function (i) {
return new Array(i + 1).join(' ');
}; // ----------------------------------------------------------------------
- // :: auto formatting of code, it require to have newlines
+ // :: Auto formatting of code, it requires to have newlines
// ----------------------------------------------------------------------
@@ -8296,7 +9117,7 @@
return token.token;
}).join('');
}; // ----------------------------------------------------------------------
- // :: flatten nested arrays
+ // :: Flatten nested arrays
// :: ref: https://stackoverflow.com/a/27282907/387194
// ----------------------------------------------------------------------
@@ -8561,9 +9382,9 @@
return result;
}; // ----------------------------------------------------------------------
- // by default to_object was created to create JavaScript objects,
- // so it use valueOf to get native values
- // literal parameter was a hack to allow create LComplex from LIPS code
+ // By default to_object was created to create JavaScript objects,
+ // so it uses valueOf to get native values.
+ // Literal parameter was a hack to allow creating LComplex from LIPS code
// ----------------------------------------------------------------------
@@ -8754,7 +9575,7 @@
str_mapping.set(key, value);
}); // ----------------------------------------------------------------------
- // :: debug function that can be used with JSON.stringify
+ // :: Debug function that can be used with JSON.stringify
// :: that will show symbols
// ----------------------------------------------------------------------
@@ -8840,7 +9661,7 @@
return '#';
}
} // ----------------------------------------------------------------------
- // instances extracted to make cyclomatic complexity of toString smaller
+ // Instances extracted to make cyclomatic complexity of toString smaller
var instances = new Map(); // ----------------------------------------------------------------------
@@ -8955,8 +9776,8 @@
var constructor = obj.constructor;
if (!constructor) {
- // this is case of fs.constants in Node.js that is null constructor object
- // this object can be handled like normal object that have properties
+ // This is case of fs.constants in Node.js that is null constructor object.
+ // This object can be handled like normal objects that have properties
constructor = Object;
}
@@ -9249,9 +10070,9 @@
function seq_compare(fn, args) {
- var _args12 = _toArray(args),
- a = _args12[0],
- rest = _args12.slice(1);
+ var _args11 = _toArray(args),
+ a = _args11[0],
+ rest = _args11.slice(1);
while (rest.length > 0) {
var _rest = rest,
@@ -9431,32 +10252,32 @@
function macro_expand(single) {
return /*#__PURE__*/function () {
- var _ref20 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee12(code, args) {
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(code, args) {
var env, bindings, let_macros, lambda, define, is_let_macro, is_procedure, is_lambda, proc_bindings, let_binding, is_macro, expand_let_binding, _expand_let_binding, traverse, _traverse;
- return regenerator.wrap(function _callee12$(_context13) {
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
while (1) {
- switch (_context13.prev = _context13.next) {
+ switch (_context12.prev = _context12.next) {
case 0:
_traverse = function _traverse3() {
- _traverse = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee11(node, n, env) {
+ _traverse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(node, n, env) {
var name, value, is_let, is_binding, second, code, result, _result, expr, scope, car, cdr, pair;
- return regenerator.wrap(function _callee11$(_context12) {
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
while (1) {
- switch (_context12.prev = _context12.next) {
+ switch (_context11.prev = _context11.next) {
case 0:
if (!(node instanceof Pair && node.car instanceof LSymbol)) {
- _context12.next = 50;
+ _context11.next = 50;
break;
}
if (!node[__data__]) {
- _context12.next = 3;
+ _context11.next = 3;
break;
}
- return _context12.abrupt("return", node);
+ return _context11.abrupt("return", node);
case 3:
name = node.car.valueOf();
@@ -9467,22 +10288,22 @@
is_binding = is_let || is_procedure(value, node) || is_lambda(value);
if (!(is_binding && node.cdr.car instanceof Pair)) {
- _context12.next = 28;
+ _context11.next = 28;
break;
}
if (!is_let) {
- _context12.next = 15;
+ _context11.next = 15;
break;
}
bindings = let_binding(node.cdr.car);
- _context12.next = 12;
+ _context11.next = 12;
return expand_let_binding(node.cdr.car, n);
case 12:
- second = _context12.sent;
- _context12.next = 17;
+ second = _context11.sent;
+ _context11.next = 17;
break;
case 15:
@@ -9490,134 +10311,134 @@
second = node.cdr.car;
case 17:
- _context12.t0 = Pair;
- _context12.t1 = node.car;
- _context12.t2 = Pair;
- _context12.t3 = second;
- _context12.next = 23;
+ _context11.t0 = Pair;
+ _context11.t1 = node.car;
+ _context11.t2 = Pair;
+ _context11.t3 = second;
+ _context11.next = 23;
return traverse(node.cdr.cdr, n, env);
case 23:
- _context12.t4 = _context12.sent;
- _context12.t5 = new _context12.t2(_context12.t3, _context12.t4);
- return _context12.abrupt("return", new _context12.t0(_context12.t1, _context12.t5));
+ _context11.t4 = _context11.sent;
+ _context11.t5 = new _context11.t2(_context11.t3, _context11.t4);
+ return _context11.abrupt("return", new _context11.t0(_context11.t1, _context11.t5));
case 28:
if (!is_macro(name, value)) {
- _context12.next = 50;
+ _context11.next = 50;
break;
}
code = value instanceof Syntax ? node : node.cdr;
- _context12.next = 32;
+ _context11.next = 32;
return value.invoke(code, _objectSpread(_objectSpread({}, args), {}, {
env: env
}), true);
case 32:
- result = _context12.sent;
+ result = _context11.sent;
if (!(value instanceof Syntax)) {
- _context12.next = 41;
+ _context11.next = 41;
break;
}
_result = result, expr = _result.expr, scope = _result.scope;
if (!(expr instanceof Pair)) {
- _context12.next = 40;
+ _context11.next = 40;
break;
}
if (!(n !== -1 && n <= 1 || n < recur_guard)) {
- _context12.next = 38;
+ _context11.next = 38;
break;
}
- return _context12.abrupt("return", expr);
+ return _context11.abrupt("return", expr);
case 38:
if (n !== -1) {
n = n - 1;
}
- return _context12.abrupt("return", traverse(expr, n, scope));
+ return _context11.abrupt("return", traverse(expr, n, scope));
case 40:
result = expr;
case 41:
if (!(result instanceof LSymbol)) {
- _context12.next = 43;
+ _context11.next = 43;
break;
}
- return _context12.abrupt("return", quote(result));
+ return _context11.abrupt("return", quote(result));
case 43:
if (!(result instanceof Pair)) {
- _context12.next = 48;
+ _context11.next = 48;
break;
}
if (!(n !== -1 && n <= 1 || n < recur_guard)) {
- _context12.next = 46;
+ _context11.next = 46;
break;
}
- return _context12.abrupt("return", result);
+ return _context11.abrupt("return", result);
case 46:
if (n !== -1) {
n = n - 1;
}
- return _context12.abrupt("return", traverse(result, n, env));
+ return _context11.abrupt("return", traverse(result, n, env));
case 48:
if (!is_atom(result)) {
- _context12.next = 50;
+ _context11.next = 50;
break;
}
- return _context12.abrupt("return", result);
+ return _context11.abrupt("return", result);
case 50:
// TODO: CYCLE DETECT
car = node.car;
if (!(car instanceof Pair)) {
- _context12.next = 55;
+ _context11.next = 55;
break;
}
- _context12.next = 54;
+ _context11.next = 54;
return traverse(car, n, env);
case 54:
- car = _context12.sent;
+ car = _context11.sent;
case 55:
cdr = node.cdr;
if (!(cdr instanceof Pair)) {
- _context12.next = 60;
+ _context11.next = 60;
break;
}
- _context12.next = 59;
+ _context11.next = 59;
return traverse(cdr, n, env);
case 59:
- cdr = _context12.sent;
+ cdr = _context11.sent;
case 60:
pair = new Pair(car, cdr);
- return _context12.abrupt("return", pair);
+ return _context11.abrupt("return", pair);
case 62:
case "end":
- return _context12.stop();
+ return _context11.stop();
}
}
}, _callee11);
@@ -9625,45 +10446,45 @@
return _traverse.apply(this, arguments);
};
- traverse = function _traverse2(_x9, _x10, _x11) {
+ traverse = function _traverse2(_x10, _x11, _x12) {
return _traverse.apply(this, arguments);
};
_expand_let_binding = function _expand_let_binding3() {
- _expand_let_binding = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee10(node, n) {
+ _expand_let_binding = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(node, n) {
var pair;
- return regenerator.wrap(function _callee10$(_context11) {
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
while (1) {
- switch (_context11.prev = _context11.next) {
+ switch (_context10.prev = _context10.next) {
case 0:
if (!(node === _nil)) {
- _context11.next = 2;
+ _context10.next = 2;
break;
}
- return _context11.abrupt("return", _nil);
+ return _context10.abrupt("return", _nil);
case 2:
pair = node.car;
- _context11.t0 = Pair;
- _context11.t1 = Pair;
- _context11.t2 = pair.car;
- _context11.next = 8;
+ _context10.t0 = Pair;
+ _context10.t1 = Pair;
+ _context10.t2 = pair.car;
+ _context10.next = 8;
return traverse(pair.cdr, n, env);
case 8:
- _context11.t3 = _context11.sent;
- _context11.t4 = new _context11.t1(_context11.t2, _context11.t3);
- _context11.next = 12;
+ _context10.t3 = _context10.sent;
+ _context10.t4 = new _context10.t1(_context10.t2, _context10.t3);
+ _context10.next = 12;
return expand_let_binding(node.cdr);
case 12:
- _context11.t5 = _context11.sent;
- return _context11.abrupt("return", new _context11.t0(_context11.t4, _context11.t5));
+ _context10.t5 = _context10.sent;
+ return _context10.abrupt("return", new _context10.t0(_context10.t4, _context10.t5));
case 14:
case "end":
- return _context11.stop();
+ return _context10.stop();
}
}
}, _callee10);
@@ -9671,7 +10492,7 @@
return _expand_let_binding.apply(this, arguments);
};
- expand_let_binding = function _expand_let_binding2(_x7, _x8) {
+ expand_let_binding = function _expand_let_binding2(_x8, _x9) {
return _expand_let_binding.apply(this, arguments);
};
@@ -9729,50 +10550,50 @@
define = global_env.get('define');
if (!(code.cdr instanceof Pair && LNumber.isNumber(code.cdr.car))) {
- _context13.next = 21;
+ _context12.next = 21;
break;
}
- _context13.t0 = quote;
- _context13.next = 19;
+ _context12.t0 = quote;
+ _context12.next = 19;
return traverse(code, code.cdr.car.valueOf(), env);
case 19:
- _context13.t1 = _context13.sent.car;
- return _context13.abrupt("return", (0, _context13.t0)(_context13.t1));
+ _context12.t1 = _context12.sent.car;
+ return _context12.abrupt("return", (0, _context12.t0)(_context12.t1));
case 21:
if (!single) {
- _context13.next = 27;
+ _context12.next = 27;
break;
}
- _context13.t2 = quote;
- _context13.next = 25;
+ _context12.t2 = quote;
+ _context12.next = 25;
return traverse(code, 1, env);
case 25:
- _context13.t3 = _context13.sent.car;
- return _context13.abrupt("return", (0, _context13.t2)(_context13.t3));
+ _context12.t3 = _context12.sent.car;
+ return _context12.abrupt("return", (0, _context12.t2)(_context12.t3));
case 27:
- _context13.t4 = quote;
- _context13.next = 30;
+ _context12.t4 = quote;
+ _context12.next = 30;
return traverse(code, -1, env);
case 30:
- _context13.t5 = _context13.sent.car;
- return _context13.abrupt("return", (0, _context13.t4)(_context13.t5));
+ _context12.t5 = _context12.sent.car;
+ return _context12.abrupt("return", (0, _context12.t4)(_context12.t5));
case 32:
case "end":
- return _context13.stop();
+ return _context12.stop();
}
}
}, _callee12, this);
}));
- return function (_x5, _x6) {
+ return function (_x6, _x7) {
return _ref20.apply(this, arguments);
};
}();
@@ -9829,7 +10650,7 @@
return _super.apply(this, arguments);
}
- return Parameter;
+ return _createClass(Parameter);
}(Syntax);
Syntax.Parameter = Parameter; // ----------------------------------------------------------------------
@@ -9850,7 +10671,7 @@
};
var expansion = scope.expansion,
define = scope.define; // pattern_names parameter is used to distinguish
- // multiple matches of ((x ...) ...) agains ((1 2 3) (1 2 3))
+ // multiple matches of ((x ...) ...) against ((1 2 3) (1 2 3))
// in loop we add x to the list so we know that this is not
// duplicated ellipsis symbol
@@ -9877,7 +10698,8 @@
}
if (pattern instanceof LSymbol && symbols.includes(pattern.literal())) {
- var ref = expansion.ref(code); // shadowing the indentifier works only with lambda and let
+ // TODO: literal() may be SLOW
+ var ref = expansion.ref(code); // shadowing the identifier works only with lambda and let
if (LSymbol.is(code, pattern)) {
if (typeof ref === 'undefined') {
@@ -10109,7 +10931,7 @@
log({
pattern: pattern.toString(),
code: code.toString()
- }); // case (x y) ===> (var0 var1 ... varn) where var1 match nil
+ }); // case (x y) ===> (var0 var1 ... warn) where var1 match nil
if (pattern.cdr instanceof Pair && pattern.car instanceof LSymbol && pattern.cdr.cdr instanceof Pair && pattern.cdr.car instanceof LSymbol && LSymbol.is(pattern.cdr.cdr.car, ellipsis_symbol) && pattern.cdr.cdr.cdr instanceof Pair && !LSymbol.is(pattern.cdr.cdr.cdr.car, ellipsis_symbol) && traverse(pattern.car, code.car, pattern_names, ellipsis) && traverse(pattern.cdr.cdr.cdr, code.cdr, pattern_names, ellipsis)) {
var _name6 = pattern.cdr.car.__name__;
@@ -10445,7 +11267,7 @@
var _ref22 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
disabled = _ref22.disabled;
- log('traverse>> ' + expr.toString());
+ log('traverse>> ' + toString(expr));
if (expr instanceof Pair) {
// escape ellispsis from R7RS e.g. (... ...)
@@ -10699,7 +11521,8 @@
var _symbols3 = Object.keys(bindings['...'].symbols);
- var _name8 = expr.literal();
+ var _name8 = expr.literal(); // TODO: slow
+
if (_symbols3.includes(_name8)) {
var msg = "missing ellipsis symbol next to name `".concat(_name8, "'");
@@ -10718,7 +11541,7 @@
return traverse(expr, {});
} // ----------------------------------------------------------------------
- // :: check for nullish values
+ // :: Check for nullish values
// ----------------------------------------------------------------------
@@ -10763,8 +11586,8 @@
function box(object) {
- // we only need to box lips data, arrays and object don't need
- // to be boxed, values from objects will be boxed when accessed
+ // We only need to box lips data and arrays. Object don't need
+ // to be boxed, but values from objects will be boxed when accessed.
switch (_typeof(object)) {
case 'string':
return LString(object);
@@ -10803,7 +11626,8 @@
function unbox(object) {
- var lips_type = [LString, LCharacter, LNumber].some(function (x) {
+ // LCharacter is unboxable #233
+ var lips_type = [LString, LNumber].some(function (x) {
return object instanceof x;
});
@@ -10843,7 +11667,7 @@
return box(value);
} // ----------------------------------------------------------------------
- // :: function get original function that was binded with props
+ // :: Function gets original function that was binded with props
// ----------------------------------------------------------------------
@@ -10854,7 +11678,7 @@
return obj;
} // ----------------------------------------------------------------------
- // :: function bind with contex that can be optionaly unbind
+ // :: Function binds with context that can be optionally unbind
// :: get original function with unbind
// ----------------------------------------------------------------------
@@ -10905,7 +11729,7 @@
return bound;
} // ----------------------------------------------------------------------
- // function used to check if function should not get unboxed arguments,
+ // Function used to check if function should not get unboxed arguments,
// so you can call Object.getPrototypeOf for lips data types
// this is case, see dir function and #73
// ----------------------------------------------------------------------
@@ -10948,7 +11772,7 @@
return false;
} // ----------------------------------------------------------------------
- // hidden props
+ // Hidden props
// ----------------------------------------------------------------------
@@ -10969,7 +11793,7 @@
var __prototype__ = Symbol["for"]('__prototype__');
var __lambda__ = Symbol["for"]('__lambda__'); // ----------------------------------------------------------------------
- // :: function bind fn with context but it also move all props
+ // :: Function bind fn with context but it also move all props
// :: mostly used for Object function
// ----------------------------------------------------------------------
@@ -11085,7 +11909,7 @@
return Pair.fromArray([LSymbol('letrec'), [[code.car, Pair(LSymbol('lambda'), Pair(params, code.cdr.cdr))]], Pair(code.car, args)]);
} else if (macro_expand) {
- // Macro.defmacro are special macros that should return lisp code
+ // Macro.defmacro are special macros that should return lips code
// here we use evaluate, so we need to check special flag set by
// macroexpand to prevent evaluation of code in normal let
return;
@@ -11295,7 +12119,7 @@
function limit_math_op(n, fn) {
- // + 1 so it inlcude function in guard_math_call
+ // + 1 so it include function in guard_math_call
return limit(n + 1, curry(guard_math_call, fn));
} // -------------------------------------------------------------------------
// :: some functional magic
@@ -11361,7 +12185,7 @@
return fn.apply(void 0, _toConsumableArray(args.slice(0, n)));
};
} // -------------------------------------------------------------------------
- // :: character object representation
+ // :: Character object representation
// -------------------------------------------------------------------------
@@ -11385,7 +12209,7 @@
_char7 = LCharacter.__names__[_char7];
} else {
// this should never happen
- // parser don't alow not defined named characters
+ // parser don't allow not defined named characters
throw new Error('Internal: Unknown named character');
}
} else {
@@ -11477,6 +12301,38 @@
_iterator11.f();
}
}
+ LString.prototype[Symbol.iterator] = /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
+ var chars, _i4, _chars, _char8;
+
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
+ while (1) {
+ switch (_context13.prev = _context13.next) {
+ case 0:
+ chars = Array.from(this.__string__);
+ _i4 = 0, _chars = chars;
+
+ case 2:
+ if (!(_i4 < _chars.length)) {
+ _context13.next = 9;
+ break;
+ }
+
+ _char8 = _chars[_i4];
+ _context13.next = 6;
+ return LCharacter(_char8);
+
+ case 6:
+ _i4++;
+ _context13.next = 2;
+ break;
+
+ case 9:
+ case "end":
+ return _context13.stop();
+ }
+ }
+ }, _callee13, this);
+ });
LString.prototype.serialize = function () {
return this.valueOf();
@@ -11513,13 +12369,13 @@
return LString(this.__string__.toUpperCase());
};
- LString.prototype.set = function (n, _char8) {
+ LString.prototype.set = function (n, _char9) {
typecheck('LString::set', n, 'number');
- typecheck('LString::set', _char8, ['string', 'character']);
+ typecheck('LString::set', _char9, ['string', 'character']);
n = n.valueOf();
- if (_char8 instanceof LCharacter) {
- _char8 = _char8.__char__;
+ if (_char9 instanceof LCharacter) {
+ _char9 = _char9.__char__;
}
var string = [];
@@ -11528,7 +12384,7 @@
string.push(this.__string__.substring(0, n));
}
- string.push(_char8);
+ string.push(_char9);
if (n < this.__string__.length - 1) {
string.push(this.__string__.substring(n + 1));
@@ -11547,15 +12403,15 @@
return LString(this.valueOf());
};
- LString.prototype.fill = function (_char9) {
- typecheck('LString::fill', _char9, ['string', 'character']);
+ LString.prototype.fill = function (_char10) {
+ typecheck('LString::fill', _char10, ['string', 'character']);
- if (_char9 instanceof LCharacter) {
- _char9 = _char9.toString();
+ if (_char10 instanceof LCharacter) {
+ _char10 = _char10.toString();
}
var len = this.__string__.length;
- this.__string__ = new Array(len + 1).join(_char9);
+ this.__string__ = new Array(len + 1).join(_char10);
}; // -------------------------------------------------------------------------
// :: Number wrapper that handle BigNumbers
// -------------------------------------------------------------------------
@@ -11590,7 +12446,7 @@
if (!LNumber.isNumber(n) && !parsable) {
throw new Error("You can't create LNumber from ".concat(type(n)));
- } // prevent infite loop https://github.com/indutny/bn.js/issues/186
+ } // prevent infinite loop https://github.com/indutny/bn.js/issues/186
if (n === null) {
@@ -11701,8 +12557,7 @@
LNumber.types = {
"float": function float(n) {
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- return new LFloat(n, force);
+ return new LFloat(n);
},
complex: function complex(n) {
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -11887,7 +12742,7 @@
return this.__value__.toNumber();
}
}; // -------------------------------------------------------------------------
- // type coercion matrix
+ // Type coercion matrix
// -------------------------------------------------------------------------
@@ -12208,10 +13063,17 @@
LNumber.prototype.pow = function (n) {
var value;
- if (LNumber.isBN(this.__value__)) {
+ var _this$coerce3 = this.coerce(n),
+ _this$coerce4 = _slicedToArray(_this$coerce3, 2),
+ a = _this$coerce4[0],
+ b = _this$coerce4[1];
+
+ if (LNumber.isNative(a.__value__) && LNumber.isNative(b.__value__)) {
+ value = pow(a.__value__, b.__value__);
+ } else if (LNumber.isBN(a.__value__) && LNumber.isBN(b.__value__)) {
value = this.__value__.pow(n.__value__);
- } else {
- value = pow(this.__value__, n.__value__);
+ } else if (a.pow) {
+ return a.pow(b);
}
return LNumber(value);
@@ -12252,10 +13114,10 @@
LNumber.prototype.cmp = function (n) {
- var _this$coerce3 = this.coerce(n),
- _this$coerce4 = _slicedToArray(_this$coerce3, 2),
- a = _this$coerce4[0],
- b = _this$coerce4[1];
+ var _this$coerce5 = this.coerce(n),
+ _this$coerce6 = _slicedToArray(_this$coerce5, 2),
+ a = _this$coerce6[0],
+ b = _this$coerce6[1];
function cmp(a, b) {
if (a.__value__ < b.__value__) {
@@ -12300,7 +13162,8 @@
return Number(n);
}
} else if (!LNumber.isComplex(n)) {
- throw new Error('Invalid constructor call for LComplex');
+ var msg = "Invalid constructor call for LComplex expect &(:im :re ) object but got ".concat(toString(n));
+ throw new Error(msg);
}
var im = n.im instanceof LNumber ? n.im : LNumber(n.im);
@@ -12350,6 +13213,11 @@
}; // -------------------------------------------------------------------------
+ LComplex.prototype.pow = function (n) {
+ throw new Error('Not yet implemented');
+ }; // -------------------------------------------------------------------------
+
+
LComplex.prototype.add = function (n) {
return this.complex_op('add', n, function (a_re, b_re, a_im, b_im) {
return {
@@ -12448,13 +13316,29 @@
throw new Error('[LComplex::div] Invalid value');
}
- var _this$coerce5 = this.coerce(n),
- _this$coerce6 = _slicedToArray(_this$coerce5, 2),
- a = _this$coerce6[0],
- b = _this$coerce6[1];
+ if (this.cmp(n) === 0) {
+ var _this$coerce7 = this.coerce(n),
+ _this$coerce8 = _slicedToArray(_this$coerce7, 2),
+ _a = _this$coerce8[0],
+ _b = _this$coerce8[1];
+
+ var ret = _a.__im__.div(_b.__im__);
+
+ return ret.coerce(_b.__re__)[0];
+ }
+
+ var _this$coerce9 = this.coerce(n),
+ _this$coerce10 = _slicedToArray(_this$coerce9, 2),
+ a = _this$coerce10[0],
+ b = _this$coerce10[1];
var denom = b.factor();
- var num = a.mul(b.conjugate());
+ var conj = b.conjugate();
+ var num = a.mul(conj);
+
+ if (!LNumber.isComplex(num)) {
+ return num.div(denom);
+ }
var re = num.__re__.op('/', denom);
@@ -12495,7 +13379,7 @@
var result = fn(_this7.__re__, re, _this7.__im__, im);
if ('im' in result && 're' in result) {
- if (result.im.cmp(0) === 0 && !LNumber.isFloat(result.im)) {
+ if (result.im.cmp(0) === 0) {
return result.re;
}
@@ -12544,10 +13428,10 @@
LComplex.prototype.cmp = function (n) {
- var _this$coerce7 = this.coerce(n),
- _this$coerce8 = _slicedToArray(_this$coerce7, 2),
- a = _this$coerce8[0],
- b = _this$coerce8[1];
+ var _this$coerce11 = this.coerce(n),
+ _this$coerce12 = _slicedToArray(_this$coerce11, 2),
+ a = _this$coerce12[0],
+ b = _this$coerce12[1];
var _a$__re__$coerce = a.__re__.coerce(b.__re__),
_a$__re__$coerce2 = _slicedToArray(_a$__re__$coerce, 2),
@@ -12676,7 +13560,7 @@
return LFloat(fn(this.__value__, n));
}; // -------------------------------------------------------------------------
- // same aproximation as in guile scheme
+ // same approximation as in guile scheme
LFloat.prototype.toRational = function () {
@@ -12741,7 +13625,7 @@
});
};
} // -------------------------------------------------------------------------
- // :: source: Kawa gnu.math.RatNum.java
+ // :: Source: Kawa gnu.math.RatNum.java
// :: This algorithm is by Alan Bawden. It has been transcribed
// :: with permission from Kawa copyright M.A. Bothner.
// :: which was transcribed from from C-Gambit, copyright Marc Feeley.
@@ -13172,11 +14056,11 @@
num: this,
denom: n
});
- } // use native calucaltion becuase it's real bigint value
+ } // use native calculation because it's real bigint value
return LBigInteger(ret, true);
- }; // -------------------------- -----------------------------------------------
+ }; // -------------------------------------------------------------------------
LBigInteger.prototype.sqrt = function () {
@@ -13201,7 +14085,7 @@
LNumber.NaN = LNumber(NaN); // -------------------------------------------------------------------------
- // :: Port abstration - read should be a function that return next line
+ // :: Port abstraction - read should be a function that return next line
// -------------------------------------------------------------------------
function InputPort(read) {
@@ -13225,9 +14109,9 @@
}
});
this._read = read;
- this._with_parser = this._with_init_parser.bind(this, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee13() {
+ this._with_parser = this._with_init_parser.bind(this, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
var line;
- return regenerator.wrap(function _callee13$(_context14) {
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
while (1) {
switch (_context14.prev = _context14.next) {
case 0:
@@ -13253,7 +14137,7 @@
return _context14.stop();
}
}
- }, _callee13);
+ }, _callee14);
})));
this.char_ready = function () {
@@ -13289,42 +14173,36 @@
InputPort.prototype._with_init_parser = function (make_parser, fn) {
var self = this;
- return /*#__PURE__*/function () {
- var _ref25 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee14() {
- var parser,
- _len16,
- args,
- _key16,
- _args17 = arguments;
-
- return regenerator.wrap(function _callee14$(_context15) {
- while (1) {
- switch (_context15.prev = _context15.next) {
- case 0:
- _context15.next = 2;
- return make_parser.call(self);
+ return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
+ var parser,
+ _len16,
+ args,
+ _key16,
+ _args17 = arguments;
+
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
+ while (1) {
+ switch (_context15.prev = _context15.next) {
+ case 0:
+ _context15.next = 2;
+ return make_parser.call(self);
- case 2:
- parser = _context15.sent;
+ case 2:
+ parser = _context15.sent;
- for (_len16 = _args17.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
- args[_key16] = _args17[_key16];
- }
+ for (_len16 = _args17.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
+ args[_key16] = _args17[_key16];
+ }
- return _context15.abrupt("return", fn.apply(void 0, [parser].concat(args)));
+ return _context15.abrupt("return", fn.apply(void 0, [parser].concat(args)));
- case 5:
- case "end":
- return _context15.stop();
- }
+ case 5:
+ case "end":
+ return _context15.stop();
}
- }, _callee14);
- }));
-
- return function () {
- return _ref25.apply(this, arguments);
- };
- }();
+ }
+ }, _callee15);
+ }));
};
InputPort.prototype.is_open = function () {
@@ -13856,7 +14734,7 @@
EOF.prototype.toString = function () {
return '#';
}; // -------------------------------------------------------------------------
- // simpler way to create interpreter with interaction-environment
+ // Simpler way to create interpreter with interaction-environment
// -------------------------------------------------------------------------
@@ -14018,7 +14896,7 @@
return new Environment(obj || {}, this, name);
}; // -------------------------------------------------------------------------
- // :: lookup function for variable doc strings
+ // :: Lookup function for variable doc strings
// -------------------------------------------------------------------------
@@ -14052,7 +14930,7 @@
return this.__parent__.doc(name);
}
}; // -------------------------------------------------------------------------
- // :: function create frame environment for usage in functions
+ // :: Function creates frame environment for usage in functions
// :: frames are used to it's easier to find environments of the functions
// :: in scope chain, they are dummy environments just for lookup
// -------------------------------------------------------------------------
@@ -14124,7 +15002,7 @@
typecheck('Environment::merge', env, 'environment');
return this.inherit(name, env.__env__);
}; // -------------------------------------------------------------------------
- // value returned in lookup if found value in env and in promise_all
+ // Value returned in lookup if found value in env and in promise_all
// -------------------------------------------------------------------------
@@ -14145,7 +15023,7 @@
Value.prototype.valueOf = function () {
return this.value;
}; // -------------------------------------------------------------------------
- // :: differnt object than value used as object for (values)
+ // :: Different object than value used as object for (values)
// -------------------------------------------------------------------------
@@ -14274,7 +15152,7 @@
return this;
}; // -------------------------------------------------------------------------
- // for internal use only
+ // For internal use only
// -------------------------------------------------------------------------
@@ -14334,7 +15212,7 @@
return result;
}; // -------------------------------------------------------------------------
- // :: Quote funtion used to pause evaluation from Macro
+ // :: Quote function used to pause evaluation from Macro
// -------------------------------------------------------------------------
@@ -14351,7 +15229,7 @@
} // -------------------------------------------------------------------------
- var native_lambda = parse(tokenize("(lambda ()\n \"[native code]\"\n (throw \"Invalid Invocation\"))"))[0]; // -------------------------------------------------------------------------------
+ var native_lambda = parse(tokenize("(lambda ()\n \"[native code]\"\n (throw \"Invalid Invocation\"))"))[0]; // -------------------------------------------------------------------------------
var get = doc('get', function get(object) {
var value;
@@ -14400,15 +15278,15 @@
}
return value;
- }, "(. obj . args)\n (get obj . args)\n\n Function use object as base and keep using arguments to get the\n property of JavaScript object. Arguments need to be a strings.\n e.g. `(. console \"log\")` if you use any function inside LIPS is\n will be weakly bind (can be rebind), so you can call this log function\n without problem unlike in JavaScript when you use\n `var log = console.log`.\n `get` is an alias because . don't work in every place, e.g. you can't\n pass it as argument."); // -------------------------------------------------------------------------
- // function get internal protected data
+ }, "(. obj . args)\n (get obj . args)\n\n This function uses an object as a base and keeps using arguments to get the\n property of JavaScript object. Arguments need to be a strings.\n e.g. `(. console \"log\")` if you use any function inside LIPS it\n will be weakly bound (can be rebound), so you can call this log function\n without problem unlike in JavaScript when you use\n `var log = console.log`.\n `get` is an alias because . doesn't work everywhere, e.g. you can't\n pass it as an argument."); // -------------------------------------------------------------------------
+ // Function gets internal protected data
// -------------------------------------------------------------------------
function internal(env, name) {
var internal_env = interaction(env, '**internal-env**');
return internal_env.get(name);
} // -------------------------------------------------------------------------
- // get variable from interaction environment
+ // Get variable from interaction environment
// -------------------------------------------------------------------------
@@ -14471,7 +15349,7 @@
typecheck_text_port('peek-char', port, 'input-port');
return port.peek_char();
- }, "(peek-char port)\n\n Function get character from string port or EOF object if no more\n data in string port."),
+ }, "(peek-char port)\n\n This function reads and returns a character from the string\n port, or, if there is no more data in the string port, it\n returns an EOF."),
// ------------------------------------------------------------------
'read-line': doc('read-line', function () {
var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
@@ -14482,7 +15360,7 @@
typecheck_text_port('read-line', port, 'input-port');
return port.read_line();
- }, "(read-char port)\n\n Function read next character from input port."),
+ }, "(read-line port)\n\n This function reads and returns the next line from the input\n port."),
// ------------------------------------------------------------------
'read-char': doc('read-char', function () {
var port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
@@ -14493,10 +15371,10 @@
typecheck_text_port('read-char', port, 'input-port');
return port.read_char();
- }, "(read-char port)\n\n Function read next character from input port."),
+ }, "(read-char port)\n\n This function reads and returns the next character from the\n input port."),
// ------------------------------------------------------------------
read: doc('read', /*#__PURE__*/function () {
- var _read2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee15() {
+ var _read2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
var arg,
_iteratorAbruptCompletion2,
_didIteratorError2,
@@ -14507,7 +15385,7 @@
port,
_args18 = arguments;
- return regenerator.wrap(function _callee15$(_context16) {
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
while (1) {
switch (_context16.prev = _context16.next) {
case 0:
@@ -14594,7 +15472,7 @@
return _context16.stop();
}
}
- }, _callee15, this, [[4, 16, 20, 30], [21,, 25, 29]]);
+ }, _callee16, this, [[4, 16, 20, 30], [21,, 25, 29]]);
}));
function read() {
@@ -14602,7 +15480,7 @@
}
return read;
- }(), "(read [string])\n\n Function if used with string will parse the string and return\n list structure of LIPS code. If called without an argument it\n will read string from standard input (using browser prompt or\n user defined way) and call itself with that string (parse is)\n function can be used together with eval to evaluate code from\n string"),
+ }(), "(read [string])\n\n This function, if used with a string, will parse it and\n return the LIPS code, if there is any. If called with a\n port, it will parse the next item from the port. If called\n without an input, it will read a string from standard input\n (using the browser's prompt or a user defined input method)\n and calls itself with that string. This function can be used\n together with `eval` to evaluate code from a string."),
// ------------------------------------------------------------------
pprint: doc('pprint', function pprint(arg) {
if (arg instanceof Pair) {
@@ -14613,7 +15491,7 @@
}
global_env.get('newline').call(global_env);
- }, "(pprint expression)\n\n Pretty print list expression, if called with non-pair it just call\n print function with passed argument."),
+ }, "(pprint expression)\n\n This function will pretty print its input to stdout. If it is called\n with a non-list, it will just call the print function on its\n input."),
// ------------------------------------------------------------------
print: doc('print', function print() {
var display = global_env.get('display');
@@ -14627,7 +15505,7 @@
display.call(global_env, arg);
newline.call(global_env);
});
- }, "(print . args)\n\n Function convert each argument to string and print the result to\n standard output (by default it's console but it can be defined\n it user code), the function call newline after printing each arg."),
+ }, "(print . args)\n\n This function converts each input into a string and prints\n the result to the standard output (by default it's the\n console but it can be defined in user code). This function\n calls `(newline)` after printing each input."),
// ------------------------------------------------------------------
format: doc('format', function format(str) {
for (var _len20 = arguments.length, args = new Array(_len20 > 1 ? _len20 - 1 : 0), _key20 = 1; _key20 < _len20; _key20++) {
@@ -14664,11 +15542,11 @@
m = str.match(/~([\S])/);
if (m) {
- throw new Error("format: Unrecognized escape seqence ".concat(m[1]));
+ throw new Error("format: Unrecognized escape sequence ".concat(m[1]));
}
return str;
- }, "(format string n1 n2 ...)\n\n Function accepts string template and replacing any escape sequences\n by arguments:\n\n * ~a value as if printed with display\n * ~s value as if printed with write\n * ~% newline character\n * ~~ literal tilde '~' is inserted\n\n if there missing arguments or other escape character it throw exception."),
+ }, "(format string n1 n2 ...)\n\n This function accepts a string template and replaces any\n escape sequences in its inputs:\n\n * ~a value as if printed with `display`\n * ~s value as if printed with `write`\n * ~% newline character\n * ~~ literal tilde '~'\n\n If there are missing inputs or other escape characters it\n will error."),
// ------------------------------------------------------------------
display: doc('display', function display(arg) {
var port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
@@ -14681,7 +15559,7 @@
var value = global_env.get('repr')(arg);
port.write.call(global_env, value);
- }, "(display arg [port])\n\n Function send string to standard output or provied port."),
+ }, "(display string [port])\n\n This function outputs the string to the standard output or\n the port if given. No newline."),
// ------------------------------------------------------------------
'display-error': doc('display-error', function error() {
var port = internal(this, 'stderr');
@@ -14694,7 +15572,7 @@
var value = args.map(repr).join(' ');
port.write.call(global_env, value);
global_env.get('newline')(port);
- }, "(display-error . args)\n\n Display error message."),
+ }, "(display-error . args)\n\n Display an error message on stderr."),
// ------------------------------------------------------------------
'%same-functions': doc('%same-functions', function (a, b) {
if (!is_function(a)) {
@@ -14706,7 +15584,7 @@
}
return unbind(a) === unbind(b);
- }, "(%same-functions a b)\n\n Helper function that check if two bound functions are the same"),
+ }, "(%same-functions a b)\n\n A helper function that checks if the two input functions are\n the same."),
// ------------------------------------------------------------------
help: doc(new Macro('help', function (code, _ref27) {
var dynamic_scope = _ref27.dynamic_scope,
@@ -14755,21 +15633,21 @@
return __doc__;
}
}
- }), "(help object)\n\n Macro returns documentation for function or macro. You can save the function\n or macro in variable and use it in context. But help for variable require\n to pass the symbol itself."),
+ }), "(help object)\n\n This macro returns documentation for a function or macro.\n You can save the function or macro in a variable and use it\n here. But getting help for a variable requires passing the\n variable in a `quote`."),
// ------------------------------------------------------------------
cons: doc('cons', function cons(car, cdr) {
return new Pair(car, cdr);
- }, "(cons left right)\n\n Function return new Pair out of two arguments."),
+ }, "(cons left right)\n\n This function returns a new list with the first appended\n before the second. If the second is not a list cons will\n return a dotted pair."),
// ------------------------------------------------------------------
car: doc('car', function car(list) {
typecheck('car', list, 'pair');
return list.car;
- }, "(car pair)\n\n Function returns car (head) of the list/pair."),
+ }, "(car pair)\n\n This function returns the car (item 1) of the list."),
// ------------------------------------------------------------------
cdr: doc('cdr', function cdr(list) {
typecheck('cdr', list, 'pair');
return list.cdr;
- }, "(cdr pair)\n\n Function returns cdr (tail) of the list/pair."),
+ }, "(cdr pair)\n\n This function returns the cdr (all but first) of the list."),
// ------------------------------------------------------------------
'set!': doc(new Macro('set!', function (code) {
var _this22 = this;
@@ -14818,7 +15696,7 @@
if (code.car instanceof Pair && LSymbol.is(code.car.car, '.')) {
var second = code.car.cdr.car;
- var thrid = code.car.cdr.cdr.car;
+ var third = code.car.cdr.cdr.car;
var object = _evaluate(second, {
env: this,
@@ -14826,7 +15704,7 @@
error: error
});
- var key = _evaluate(thrid, {
+ var key = _evaluate(third, {
env: this,
dynamic_scope: dynamic_scope,
error: error
@@ -14867,7 +15745,7 @@
ref.set(symbol, value);
});
- }), "(set! name value)\n\n Macro that can be used to set the value of the variable (mutate)\n it search the scope chain until it finds first non emtpy slot and set it."),
+ }), "(set! name value)\n\n Macro that can be used to set the value of the variable or slot (mutate it).\n set! searches the scope chain until it finds first non empty slot and sets it."),
// ------------------------------------------------------------------
'unset!': doc(new Macro('set!', function (code) {
if (!(code.car instanceof LSymbol)) {
@@ -14880,23 +15758,23 @@
if (ref) {
delete ref.__env__[symbol.__name__];
}
- }), "(unset! name)\n\n Function delete specified name from environment."),
+ }), "(unset! name)\n\n Function to delete the specified name from environment.\n Trying to access the name afterwards will error."),
// ------------------------------------------------------------------
'set-car!': doc('set-car!', function (slot, value) {
typecheck('set-car!', slot, 'pair');
slot.car = value;
- }, "(set-car! obj value)\n\n Function that set car (head) of the list/pair to specified value.\n It can destroy the list. Old value is lost."),
+ }, "(set-car! obj value)\n\n Function that sets the car (first item) of the list/pair to specified value.\n The old value is lost."),
// ------------------------------------------------------------------
'set-cdr!': doc('set-cdr!', function (slot, value) {
typecheck('set-cdr!', slot, 'pair');
slot.cdr = value;
- }, "(set-cdr! obj value)\n\n Function that set cdr (tail) of the list/pair to specified value.\n It can destroy the list. Old value is lost."),
+ }, "(set-cdr! obj value)\n\n Function that sets the cdr (tail) of the list/pair to specified value.\n It will destroy the list. The old tail is lost."),
// ------------------------------------------------------------------
'empty?': doc('empty?', function (x) {
return typeof x === 'undefined' || x === _nil;
- }, "(empty? object)\n\n Function return true if value is undfined empty list."),
+ }, "(empty? object)\n\n Function that returns #t if value is nil (an empty list) or undefined."),
// ------------------------------------------------------------------
- gensym: doc('gensym', gensym, "(gensym)\n\n Function generate unique symbol, to use with macros as meta name."),
+ gensym: doc('gensym', gensym, "(gensym)\n\n Generates a unique symbol that is not bound anywhere,\n to use with macros as meta name."),
// ------------------------------------------------------------------
load: doc('load', function load(file, env) {
typecheck('load', file, 'string');
@@ -14961,10 +15839,10 @@
if (is_node()) {
return new Promise( /*#__PURE__*/function () {
- var _ref29 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee16(resolve, reject) {
+ var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(resolve, reject) {
var path, cmd, _args19;
- return regenerator.wrap(function _callee16$(_context17) {
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
while (1) {
switch (_context17.prev = _context17.next) {
case 0:
@@ -15025,10 +15903,10 @@
return _context17.stop();
}
}
- }, _callee16);
+ }, _callee17);
}));
- return function (_x12, _x13) {
+ return function (_x13, _x14) {
return _ref29.apply(this, arguments);
};
}());
@@ -15045,13 +15923,13 @@
}).then(function () {})["finally"](function () {
global_env.set(PATH, module_path);
});
- }, "(load filename)\n (load filename environment)\n\n Function fetch the file and evaluate its content as LIPS code,\n If second argument is provided and it's environment the evaluation\n will happen in that environment."),
+ }, "(load filename)\n (load filename environment)\n\n Fetches the file (from disk or network) and evaluates its content as LIPS code.\n If the second argument is provided and it's an environment the evaluation\n will happen in that environment."),
// ------------------------------------------------------------------
'do': doc(new Macro('do', /*#__PURE__*/function () {
- var _ref30 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee18(code, _ref31) {
+ var _ref30 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(code, _ref31) {
var dynamic_scope, error, self, scope, vars, test, body, eval_args, node, item, _loop3;
- return regenerator.wrap(function _callee18$(_context19) {
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
while (1) {
switch (_context19.prev = _context19.next) {
case 0:
@@ -15105,10 +15983,10 @@
dynamic_scope: dynamic_scope,
error: error
};
- _loop3 = /*#__PURE__*/regenerator.mark(function _callee17() {
+ _loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
var node, next, _item, value, symbols;
- return regenerator.wrap(function _callee17$(_context18) {
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
while (1) {
switch (_context18.prev = _context18.next) {
case 0:
@@ -15160,7 +16038,7 @@
return _context18.stop();
}
}
- }, _callee17);
+ }, _callee18);
});
case 23:
@@ -15198,13 +16076,13 @@
return _context19.stop();
}
}
- }, _callee18, this);
+ }, _callee19, this);
}));
- return function (_x14, _x15) {
+ return function (_x15, _x16) {
return _ref30.apply(this, arguments);
};
- }()), "(do (( )) (test expression) . body)\n\n Iteration macro that evaluate the expression body in scope of the variables.\n On Eeach loop it increase the variables according to next expression and run\n test to check if the loop should continue. If test is signle call the macro\n will not return anything. If the test is pair of expression and value the\n macro will return that value after finish."),
+ }()), "(do (( )) (test return) . body)\n\n Iteration macro that evaluates the expression body in scope of the variables.\n On each loop it changes the variables according to the expression and runs\n test to check if the loop should continue. If test is a single value, the macro\n will return undefined. If the test is a pair of expressions the macro will\n evaluate and return the second expression after the loop exits."),
// ------------------------------------------------------------------
'if': doc(new Macro('if', function (code, _ref32) {
var dynamic_scope = _ref32.dynamic_scope,
@@ -15243,7 +16121,7 @@
});
return unpromise(cond, resolve);
- }), "(if cond true-expr false-expr)\n\n Macro evaluate condition expression and if the value is true, it\n evaluate and return true expression if not it evaluate and return\n false expression"),
+ }), "(if cond true-expr false-expr)\n\n Macro that evaluates cond expression and if the value is true, it\n evaluates and returns true-expression, if not it evaluates and returns\n false-expression."),
// ------------------------------------------------------------------
'let-env': new Macro('let-env', function (code) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -15265,19 +16143,19 @@
error: error
});
});
- }, "(let-env env . body)\n\n Special macro that evaluate body in context of given environment\n object."),
+ }, "(let-env env . body)\n\n Special macro that evaluates body in context of given environment\n object."),
// ------------------------------------------------------------------
- 'letrec': doc(let_macro(Symbol["for"]('letrec')), "(letrec ((a value-a) (b value-b)) body)\n\n Macro that creates new environment, then evaluate and assign values to\n names and then evaluate the body in context of that environment.\n Values are evaluated sequentialy and next value can access to\n previous values/names."),
+ 'letrec': doc(let_macro(Symbol["for"]('letrec')), "(letrec ((a value-a) (b value-b) ...) . body)\n\n Macro that creates a new environment, then evaluates and assigns values to\n names and then evaluates the body in context of that environment.\n Values are evaluated sequentially and the next value can access the\n previous values/names."),
// ---------------------------------------------------------------------
- 'letrec*': doc(let_macro(Symbol["for"]('letrec')), "(letrec* ((a value-a) (b value-b)) body)\n\n Same as letrec but the order of execution of the binding is guaranteed,\n so use can use recursive code as well as reference previous binding.\n In LIPS both letrec and letrec* behave the same."),
+ 'letrec*': doc(let_macro(Symbol["for"]('letrec')), "(letrec* ((a value-a) (b value-b) ...) . body)\n\n Same as letrec but the order of execution of the binding is guaranteed,\n so you can use recursive code as well as referencing the previous binding.\n\n In LIPS both letrec and letrec* behave the same."),
// ---------------------------------------------------------------------
- 'let*': doc(let_macro(Symbol["for"]('let*')), "(let* ((a value-a) (b value-b)) body)\n\n Macro similar to `let` but next argument get environment\n from previous let variable, so they you can define one variable,\n and use in next argument."),
+ 'let*': doc(let_macro(Symbol["for"]('let*')), "(let* ((a value-a) (b value-b) ...) . body)\n\n Macro similar to `let`, but the subsequent bindings after the first\n are evaluated in the environment including the previous let variables,\n so you can define one variable, and use it in the next's definition."),
// ---------------------------------------------------------------------
- 'let': doc(let_macro(Symbol["for"]('let')), "(let ((a value-a) (b value-b)) body)\n\n Macro that creates new environment, then evaluate and assign values to\n names and then evaluate the body in context of that environment.\n Values are evaluated sequentialy but you can't access\n previous values/names when next are evaluated. You can only get them\n from body of let expression."),
+ 'let': doc(let_macro(Symbol["for"]('let')), "(let ((a value-a) (b value-b) ...) . body)\n\n Macro that creates a new environment, then evaluates and assigns values to names,\n and then evaluates the body in context of that environment. Values are evaluated\n sequentially but you can't access previous values/names when the next are\n evaluated. You can only get them in the body of the let expression. (If you want\n to define multiple variables and use them in each other's definitions, use\n `let*`.)"),
// ------------------------------------------------------------------
'begin*': doc(pararel('begin*', function (values) {
return values.pop();
- }), "(begin* . expr)\n\n This macro is parallel version of begin. It evaluate each expression and\n if it's a promise it will evaluate it in parallel and return value\n of last expression."),
+ }), "(begin* . body)\n\n This macro is a parallel version of begin. It evaluates each expression\n in the body and if it's a promise it will await it in parallel and return\n the value of the last expression (i.e. it uses Promise.all())."),
// ------------------------------------------------------------------
'begin': doc(new Macro('begin', function (code, options) {
var args = Object.assign({}, options);
@@ -15303,7 +16181,7 @@
return result;
}
}();
- }), "(begin . args)\n\n Macro runs list of expression and return valuate of the list one.\n It can be used in place where you can only have single exression,\n like if expression."),
+ }), "(begin . args)\n\n Macro that runs a list of expressions in order and returns the value\n of the last one. It can be used in places where you can only have a\n single expression, like (if)."),
// ------------------------------------------------------------------
'ignore': new Macro('ignore', function (code, _ref33) {
var dynamic_scope = _ref33.dynamic_scope,
@@ -15318,7 +16196,7 @@
}
_evaluate(new Pair(new LSymbol('begin'), code), args);
- }, "(ignore expression)\n\n Macro that will evaluate expression and swallow any promises that may\n be created. It wil run and ignore any value that may be returned by\n expression. The code should have side effects and/or when it's promise\n it should resolve to undefined."),
+ }, "(ignore . body)\n\n Macro that will evaluate the expression and swallow any promises that may\n be created. It will discard any value that may be returned by the last body\n expression. The code should have side effects and/or when it's promise\n it should resolve to undefined."),
// ------------------------------------------------------------------
'call/cc': doc(Macro.defmacro('call/cc', function (code) {
var eval_args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -15332,7 +16210,7 @@
return result(new Continuation(null));
}
});
- }), "(call/cc proc)\n\n TODO"),
+ }), "(call/cc proc)\n\n Call-with-current-continuation.\n\n NOT SUPPORTED BY LIPS RIGHT NOW"),
// ------------------------------------------------------------------
define: doc(Macro.defmacro('define', function (code, eval_args) {
var env = this;
@@ -15382,9 +16260,11 @@
env.set(code.car, value, __doc__, true);
});
- }), "(define name expression)\n (define name expression \"doc string\")\n (define (function-name . args) body)\n\n Macro for defining values. It can be used to define variables,\n or function. If first argument is list it will create function\n with name beeing first element of the list. The macro evalute\n code `(define function (lambda args body))`"),
+ }), "(define name expression)\n (define name expression \"doc string\")\n (define (function-name . args) . body)\n\n Macro for defining values. It can be used to define variables,\n or functions. If the first argument is list it will create a function\n with name being first element of the list. This form expands to\n `(define function-name (lambda args body))`"),
// ------------------------------------------------------------------
'set-obj!': doc('set-obj!', function (obj, key, value) {
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
+
var obj_type = _typeof(obj);
if (is_null(obj) || obj_type !== 'object' && obj_type !== 'function') {
@@ -15406,11 +16286,18 @@
} else {
obj[key] = value && !is_prototype(value) ? value.valueOf() : value;
}
- }, "(set-obj! obj key value)\n\n Function set property of JavaScript object"),
+
+ if (props) {
+ var _value4 = obj[key];
+ Object.defineProperty(obj, key, _objectSpread(_objectSpread({}, options), {}, {
+ value: _value4
+ }));
+ }
+ }, "(set-obj! obj key value)\n (set-obj! obj key value props)\n\n Function set a property of a JavaScript object. props should be a vector of pairs,\n passed to Object.defineProperty."),
// ------------------------------------------------------------------
'null-environment': doc('null-environment', function () {
return global_env.inherit('null');
- }, "(null-environment)\n\n Function return new base environment with std lib."),
+ }, "(null-environment)\n\n Returns a clean environment with only the standard library."),
// ------------------------------------------------------------------
'values': doc('values', function values() {
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
@@ -15418,7 +16305,7 @@
}
return Values(args);
- }, "(values a1 a2 ...)\n\n If called with more then one elment it will create special\n Values object that can be used in call-with-values function"),
+ }, "(values a1 a2 ...)\n\n If called with more then one element it will create a special\n Values object that can be used in the call-with-values function."),
// ------------------------------------------------------------------
'call-with-values': doc('call-with-values', function (producer, consumer) {
typecheck('call-with-values', producer, 'function', 1);
@@ -15430,7 +16317,7 @@
}
return consumer(maybe);
- }, "(call-with-values producer consumer)\n\n Calls its producer argument with no values and a continuation that,\n when passed some values, calls the consumer procedure with those\n values as arguments."),
+ }, "(call-with-values producer consumer)\n\n Calls the producer procedure with no arguments, then calls the\n consumer procedure with the returned value as an argument -- unless\n the returned value is a special Values object created by (values), if it is\n the values are unpacked and the consumer is called with multiple arguments."),
// ------------------------------------------------------------------
'current-environment': doc('current-environment', function () {
if (this.__name__ === '__frame__') {
@@ -15438,11 +16325,11 @@
}
return this;
- }, "(current-environment)\n\n Function return current environement."),
+ }, "(current-environment)\n\n Function that returns the current environment (they're first-class objects!)"),
// ------------------------------------------------------------------
'parent.frame': doc('parent.frame', function () {
return user_env;
- }, "(parent.frame)\n\n Return parent environment if called from inside function.\n If no parent frame found it return nil."),
+ }, "(parent.frame)\n\n Returns the parent environment if called from inside a function.\n If no parent frame can be found it returns nil."),
// ------------------------------------------------------------------
'eval': doc('eval', function (code, env) {
var _this23 = this;
@@ -15463,7 +16350,7 @@
}
}
});
- }, "(eval expr)\n (eval expr environment)\n\n Function evalute LIPS Scheme code."),
+ }, "(eval expr)\n (eval expr environment)\n\n Function that evaluates LIPS Scheme code. If the second argument is provided\n it will be the environment that the code is evaluated in."),
// ------------------------------------------------------------------
lambda: new Macro('lambda', function (code) {
var _ref34 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
@@ -15578,7 +16465,7 @@
return doc(set_fn_length(lambda, length), __doc__, true);
- }, "(lambda (a b) body)\n (lambda args body)\n (lambda (a b . rest) body)\n\n Macro lambda create new anonymous function, if first element of the body\n is string and there is more elements it will be documentation, that can\n be read using (help fn)"),
+ }, "(lambda (a b) body)\n (lambda args body)\n (lambda (a b . rest) body)\n\n The lambda macro creates a new anonymous function. If the first element of\n the body is a string and there is more elements the string is used as the\n documentation string, that can be read using (help fn)."),
'macroexpand': new Macro('macroexpand', macro_expand()),
'macroexpand-1': new Macro('macroexpand-1', macro_expand(true)),
// ------------------------------------------------------------------
@@ -15659,7 +16546,7 @@
makro_instance.__code__ = new Pair(new LSymbol('define-macro'), macro);
this.set(name, makro_instance);
}
- }), "(define-macro (name . args) body)\n\n Meta macro, macro that create new macros, if return value is list structure\n it will be evaluated when macro is invoked. You can use quasiquote ` and\n unquote , and unquote-splicing ,@ inside to create expression that will be\n evaluated on runtime. Macros works like this: if you pass any expression to\n macro the arguments will not be evaluated unless macro itself evaluate it.\n Because of this macro can manipulate expression (arguments) as lists."),
+ }), "(define-macro (name . args) body)\n\n The meta-macro, that creates new macros. If the return value is a list structure\n it will be evaluated where the macro is invoked from. You can use quasiquote `\n and unquote , and unquote-splicing ,@ inside to create an expression that will be\n evaluated at runtime. Macros works like this: if you pass any expression to a\n macro the arguments will not be evaluated unless the macro's body explicitly\n calls (eval) on it. Because of this a macro can manipulate the expression\n (arguments) as lists."),
// ------------------------------------------------------------------
'syntax-rules': new Macro('syntax-rules', function (macro, options) {
var dynamic_scope = options.dynamic_scope,
@@ -15800,17 +16687,17 @@
}, env);
syntax.__code__ = macro;
return syntax;
- }, "(syntax-rules () (pattern expression) ...)\n\n Base of Hygienic macro, it will return new syntax expander\n that works like lisp macros."),
+ }, "(syntax-rules () (pattern expression) ...)\n\n Base of hygienic macros, it will return a new syntax expander\n that works like Lisp macros."),
// ------------------------------------------------------------------
quote: doc(new Macro('quote', function (arg) {
return quote(arg.car);
- }), "(quote expression)\n\n Macro that return single lips expression as data (it don't evaluate its\n argument). It will return list of pairs if put in front of lips code.\n And if put in fron of symbol it will return that symbol not value\n associated with that name."),
+ }), "(quote expression) or 'expression\n\n Macro that returns a single LIPS expression as data (it won't evaluate the\n argument). It will return a list if put in front of LIPS code.\n And if put in front of a symbol it will return the symbol itself, not the value\n bound to that name."),
'unquote-splicing': doc('unquote-splicing', function () {
throw new Error("You can't call `unquote-splicing` outside of quasiquote");
- }, "(unquote-splicing code)\n\n Special form to be used in quasiquote macro, parser is processing special\n characters ,@ and create call to this pseudo function. It can be used\n to evalute expression inside and return the value without parenthesis.\n the value will be joined to the output list structure."),
+ }, "(unquote-splicing code) or ,@code\n\n Special form used in the quasiquote macro. It evaluates the expression inside and\n splices the list into quasiquote's result. If it is not the last element of the\n expression, the computed value must be a pair."),
'unquote': doc('unquote', function () {
throw new Error("You can't call `unquote` outside of quasiquote");
- }, "(unquote code)\n\n Special form to be used in quasiquote macro, parser is processing special\n characters , and create call to this pseudo function. It can be used\n to evalute expression inside and return the value, the output is inserted\n into list structure created by queasiquote."),
+ }, "(unquote code) or ,code\n\n Special form used in the quasiquote macro. It evaluates the expression inside and\n substitutes the value into quasiquote's result."),
// ------------------------------------------------------------------
quasiquote: Macro.defmacro('quasiquote', function (arg, env) {
var dynamic_scope = env.dynamic_scope,
@@ -16173,12 +17060,12 @@
clear(value);
return quote(value);
});
- }, "(quasiquote list ,value ,@value)\n\n Similar macro to `quote` but inside it you can use special\n expressions unquote abbreviated to , that will evaluate expresion inside\n and return its value or unquote-splicing abbreviated to ,@ that will\n evaluate expression but return value without parenthesis (it will join)\n the list with its value. Best used with macros but it can be used outside"),
+ }, "(quasiquote list)\n\n Similar macro to `quote` but inside it you can use special expressions (unquote\n x) abbreviated to ,x that will evaluate x and insert its value verbatim or\n (unquote-splicing x) abbreviated to ,@x that will evaluate x and splice the value\n into the result. Best used with macros but it can be used outside."),
// ------------------------------------------------------------------
clone: doc('clone', function clone(list) {
typecheck('clone', list, 'pair');
return list.clone();
- }, "(clone list)\n\n Function return clone of the list."),
+ }, "(clone list)\n\n Function that returns a clone of the list, that does not share any pairs with the\n original, so the clone can be safely mutated without affecting the original."),
// ------------------------------------------------------------------
append: doc('append', function append() {
var _global_env$get;
@@ -16195,7 +17082,7 @@
return item;
});
return (_global_env$get = global_env.get('append!')).call.apply(_global_env$get, [this].concat(_toConsumableArray(items)));
- }, "(append item ...)\n\n Function will create new list with eac argument appended to the end.\n It will always return new list and not modify it's arguments."),
+ }, "(append item ...)\n\n Function that creates a new list with each argument appended end-to-end.\n It will always return a new list and not modify its arguments."),
// ------------------------------------------------------------------
'append!': doc('append!', function () {
var is_list = global_env.get('list?');
@@ -16225,7 +17112,7 @@
return acc.append(item);
}, _nil);
- }, "(append! arg1 ...)\n\n Destructive version of append, it modify the list in place. It return\n new list where each argument is appened to the end. It may modify\n lists added as arguments."),
+ }, "(append! arg1 ...)\n\n Destructive version of append, it can modify the lists in place. It returns\n a new list where each argument is appended to the end. It may modify\n lists added as arguments."),
// ------------------------------------------------------------------
reverse: doc('reverse', function reverse(arg) {
typecheck('reverse', arg, ['array', 'pair', 'nil']);
@@ -16242,7 +17129,7 @@
} else {
return arg.reverse();
}
- }, "(reverse list)\n\n Function will reverse the list or array. If value is not a list\n or array it will throw exception."),
+ }, "(reverse list)\n\n Function that reverses the list or array. If value is not a list\n or array it will error."),
// ------------------------------------------------------------------
nth: doc('nth', function nth(index, obj) {
typecheck('nth', index, 'number');
@@ -16267,7 +17154,7 @@
} else {
throw new Error(typeErrorMessage('nth', type(obj), 'array or pair', 2));
}
- }, "(nth index obj)\n\n Function return nth element of the list or array. If used with different\n value it will throw exception"),
+ }, "(nth index obj)\n\n Function that returns the nth element of the list or array.\n If used with a non-indexable value it will error."),
// ------------------------------------------------------------------
list: doc('list', function list() {
for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
@@ -16277,14 +17164,14 @@
return args.reverse().reduce(function (list, item) {
return new Pair(item, list);
}, _nil);
- }, "(list . args)\n\n Function create new list out of its arguments."),
+ }, "(list . args)\n\n Function that creates a new list out of its arguments."),
// ------------------------------------------------------------------
substring: doc('substring', function substring(string, start, end) {
typecheck('substring', string, 'string');
typecheck('substring', start, 'number');
typecheck('substring', end, ['number', 'undefined']);
return string.substring(start.valueOf(), end && end.valueOf());
- }, "(substring string start end)\n\n Function return part of the string starting at start ending with end."),
+ }, "(substring string start end)\n\n Function that returns the slice of the string starting at start and ending\n with end."),
// ------------------------------------------------------------------
concat: doc('concat', function concat() {
for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {
@@ -16295,48 +17182,48 @@
return typecheck('concat', arg, 'string', i + 1);
});
return args.join('');
- }, "(concat . strings)\n\n Function create new string by joining its arguments"),
+ }, "(concat . strings)\n\n Function that creates a new string by joining its arguments."),
// ------------------------------------------------------------------
join: doc('join', function join(separator, list) {
typecheck('join', separator, 'string');
typecheck('join', list, ['pair', 'nil']);
return global_env.get('list->array')(list).join(separator);
- }, "(join separator list)\n\n Function return string by joining elements of the list"),
+ }, "(join separator list)\n\n Function that returns a string by joining elements of the list using separator."),
// ------------------------------------------------------------------
split: doc('split', function split(separator, string) {
typecheck('split', separator, ['regex', 'string']);
typecheck('split', string, 'string');
return global_env.get('array->list')(string.split(separator));
- }, "(split separator string)\n\n Function create list by splitting string by separatar that can\n be a string or regular expression."),
+ }, "(split separator string)\n\n Function that creates a list by splitting string by separator which can\n be a string or regular expression."),
// ------------------------------------------------------------------
replace: doc('replace', function replace(pattern, replacement, string) {
typecheck('replace', pattern, ['regex', 'string']);
typecheck('replace', replacement, ['string', 'function']);
typecheck('replace', string, 'string');
return string.replace(pattern, replacement);
- }, "(replace pattern replacement string)\n\n Function change pattern to replacement inside string. Pattern can be string\n or regex and replacement can be function or string."),
+ }, "(replace pattern replacement string)\n\n Function that changes pattern to replacement inside string. Pattern can be a\n string or regex and replacement can be function or string. See Javascript\n String.replace()."),
// ------------------------------------------------------------------
match: doc('match', function match(pattern, string) {
typecheck('match', pattern, ['regex', 'string']);
typecheck('match', string, 'string');
var m = string.match(pattern);
return m ? global_env.get('array->list')(m) : false;
- }, "(match pattern string)\n\n function return match object from JavaScript as list or #f if not match."),
+ }, "(match pattern string)\n\n Function that returns a match object from JavaScript as a list or #f if\n no match."),
// ------------------------------------------------------------------
search: doc('search', function search(pattern, string) {
typecheck('search', pattern, ['regex', 'string']);
typecheck('search', string, 'string');
return string.search(pattern);
- }, "(search pattern string)\n\n Function return first found index of the pattern inside a string"),
+ }, "(search pattern string)\n\n Function that returns the first found index of the pattern inside a string."),
// ------------------------------------------------------------------
repr: doc('repr', function repr(obj, quote) {
return toString(obj, quote);
- }, "(repr obj)\n\n Function return string LIPS representation of an object as string."),
+ }, "(repr obj)\n\n Function that returns a LIPS code representation of the object as a string."),
// ------------------------------------------------------------------
'escape-regex': doc('escape-regex', function (string) {
typecheck('escape-regex', string, 'string');
return escape_regex(string.valueOf());
- }, "(escape-regex string)\n\n Function return new string where all special operators used in regex,\n are escaped with slash so they can be used in RegExp constructor\n to match literal string"),
+ }, "(escape-regex string)\n\n Function that returns a new string where all special operators used in regex,\n are escaped with backslashes so they can be used in the RegExp constructor\n to match a literal string."),
// ------------------------------------------------------------------
env: doc('env', function env(env) {
env = env || this;
@@ -16355,7 +17242,7 @@
}
return result;
- }, "(env)\n (env obj)\n\n Function return list of values (functions, macros and variables)\n inside environment and it's parents."),
+ }, "(env)\n (env obj)\n\n Function that returns a list of names (functions, macros and variables)\n that are bound in the current environment or one of its parents."),
// ------------------------------------------------------------------
'new': doc('new', function (obj) {
for (var _len28 = arguments.length, args = new Array(_len28 > 1 ? _len28 - 1 : 0), _key28 = 1; _key28 < _len28; _key28++) {
@@ -16367,34 +17254,34 @@
})));
return instance;
- }, "(new obj . args)\n\n Function create new JavaScript instance of an object."),
+ }, "(new obj . args)\n\n Function that creates new JavaScript instance of an object."),
// ------------------------------------------------------------------
- 'typecheck': doc(typecheck, "(typecheck label value type [position])\n\n Function check type and throw exception if type don't match.\n Type can be string or list of strings. Position optional argument\n is used to created proper error message."),
+ 'typecheck': doc(typecheck, "(typecheck label value type [position])\n\n Checks the type of value and errors if the type is not one allowed. Type can be\n string or list of strings. The position optional argument is used to create a\n proper error message for the nth argument of function calls."),
// ------------------------------------------------------------------
'unset-special!': doc('unset-special!', function (symbol) {
typecheck('remove-special!', symbol, 'string');
delete specials.remove(symbol.valueOf());
- }, "(unset-special! name)\n\n Function remove special symbol from parser. Added by `set-special!`,\n name must be a string."),
+ }, "(unset-special! name)\n\n Function that removes a special symbol from parser added by `set-special!`,\n name must be a string."),
// ------------------------------------------------------------------
'set-special!': doc('set-special!', function (seq, name) {
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specials.LITERAL;
typecheck('set-special!', seq, 'string', 1);
typecheck('set-special!', name, 'symbol', 2);
specials.append(seq.valueOf(), name, type);
- }, "(set-special! symbol name [type])\n\n Add special symbol to the list of transforming operators by the parser.\n e.g.: `(add-special! \"#\" 'x)` will allow to use `#(1 2 3)` and it will be\n transformed into (x (1 2 3)) so you can write x macro that will process\n the list. 3rd argument is optional and it can be constant value\n lips.specials.SPLICE if this constant is used it will transform\n `#(1 2 3)` into (x 1 2 3) that is required by # that define vectors."),
+ }, "(set-special! symbol name [type])\n\n Add a special symbol to the list of transforming operators by the parser.\n e.g.: `(add-special! \"#\" 'x)` will allow to use `#(1 2 3)` and it will be\n transformed into (x (1 2 3)) so you can write x macro that will process\n the list. 3rd argument is optional, and it can be one of two values:\n lips.specials.LITERAL, which is the default behavior, or\n lips.specials.SPLICE which causes the value to be unpacked into the expression.\n This can be used for e.g. to make `#(1 2 3)` into (x 1 2 3) that is needed\n by # that defines vectors."),
// ------------------------------------------------------------------
'get': get,
'.': get,
// ------------------------------------------------------------------
- 'unbind': doc(unbind, "(unbind fn)\n\n Function remove bidning from function so you can get props from it."),
+ 'unbind': doc(unbind, "(unbind fn)\n\n Function that removes the weak 'this' binding from a function so you\n can get properties from the actual function object."),
// ------------------------------------------------------------------
- type: doc(type, "(type object)\n\n Function return type of an object as string."),
+ type: doc(type, "(type object)\n\n Function that returns the type of an object as string."),
// ------------------------------------------------------------------
'debugger': doc('debugger', function () {
/* eslint-disable */
debugger;
/* eslint-enable */
- }, "(debugger)\n\n Function stop JavaScript code in debugger."),
+ }, "(debugger)\n\n Function that triggers the JavaScript debugger (e.g. the browser devtools)\n using the \"debugger;\" statement. If a debugger is not running this\n function does nothing."),
// ------------------------------------------------------------------
'in': doc('in', function (a, b) {
if (a instanceof LSymbol || a instanceof LString || a instanceof LNumber) {
@@ -16402,19 +17289,19 @@
}
return a in unbox(b);
- }, "(in key value)\n\n Function use is in operator to check if value is in object."),
+ }, "(in key value)\n\n Function that uses the Javascript \"in\" operator to check if key is\n a valid property in the value."),
// ------------------------------------------------------------------
'instanceof': doc('instanceof', function (type, obj) {
return obj instanceof unbind(type);
- }, "(instanceof type obj)\n\n Function check of object is instance of object."),
+ }, "(instanceof type obj)\n\n Predicate that tests if the obj is an instance of type."),
// ------------------------------------------------------------------
- 'prototype?': doc('prototype?', is_prototype, "(prototype? obj)\n\n Function check if value is JavaScript Object prototype."),
+ 'prototype?': doc('prototype?', is_prototype, "(prototype? obj)\n\n Predicate that tests if value is a valid JavaScript prototype,\n i.e. calling (new) with it will not throw ' is not a constructor'."),
// ------------------------------------------------------------------
'macro?': doc('macro?', function (obj) {
return obj instanceof Macro;
- }, "(macro? expression)\n\n Function check if value is a macro."),
+ }, "(macro? expression)\n\n Predicate that tests if value is a macro."),
// ------------------------------------------------------------------
- 'function?': doc('function?', is_function, "(function? expression)\n\n Function check if value is a function."),
+ 'function?': doc('function?', is_function, "(function? expression)\n\n Predicate that tests if value is a callable function."),
// ------------------------------------------------------------------
'real?': doc('real?', function (value) {
if (type(value) !== 'number') {
@@ -16426,57 +17313,57 @@
}
return LNumber.isFloat(value);
- }, "(real? number)\n\n Function check if value is real number."),
+ }, "(real? number)\n\n Predicate that tests if value is a real number (not complex)."),
// ------------------------------------------------------------------
'number?': doc('number?', function (x) {
return Number.isNaN(x) || LNumber.isNumber(x);
- }, "(number? expression)\n\n Function check if value is a number or NaN value."),
+ }, "(number? expression)\n\n Predicate that tests if value is a number or NaN value."),
// ------------------------------------------------------------------
'string?': doc('string?', function (obj) {
return LString.isString(obj);
- }, "(string? expression)\n\n Function check if value is a string."),
+ }, "(string? expression)\n\n Predicate that tests if value is a string."),
// ------------------------------------------------------------------
'pair?': doc('pair?', function (obj) {
return obj instanceof Pair;
- }, "(pair? expression)\n\n Function check if value is a pair or list structure."),
+ }, "(pair? expression)\n\n Predicate that tests if value is a pair or list structure."),
// ------------------------------------------------------------------
'regex?': doc('regex?', function (obj) {
return obj instanceof RegExp;
- }, "(regex? expression)\n\n Function check if value is regular expression."),
+ }, "(regex? expression)\n\n Predicate that tests if value is a regular expression."),
// ------------------------------------------------------------------
'null?': doc('null?', function (obj) {
return is_null(obj);
- }, "(null? expression)\n\n Function check if value is nulish."),
+ }, "(null? expression)\n\n Predicate that tests if value is null-ish (i.e. undefined, nil, or\n Javascript null)."),
// ------------------------------------------------------------------
'boolean?': doc('boolean?', function (obj) {
return typeof obj === 'boolean';
- }, "(boolean? expression)\n\n Function check if value is boolean."),
+ }, "(boolean? expression)\n\n Predicate that tests if value is a boolean (#t or #f)."),
// ------------------------------------------------------------------
'symbol?': doc('symbol?', function (obj) {
return obj instanceof LSymbol;
- }, "(symbol? expression)\n\n Function check if value is LIPS symbol"),
+ }, "(symbol? expression)\n\n Predicate that tests if value is a LIPS symbol."),
// ------------------------------------------------------------------
'array?': doc('array?', function (obj) {
return obj instanceof Array;
- }, "(array? expression)\n\n Function check if value is an arrray."),
+ }, "(array? expression)\n\n Predicate that tests if value is an array."),
// ------------------------------------------------------------------
'object?': doc('object?', function (obj) {
return obj !== _nil && obj !== null && !(obj instanceof LCharacter) && !(obj instanceof RegExp) && !(obj instanceof LString) && !(obj instanceof Pair) && !(obj instanceof LNumber) && _typeof(obj) === 'object' && !(obj instanceof Array);
- }, "(object? expression)\n\n Function check if value is an plain object."),
+ }, "(object? expression)\n\n Predicate that tests if value is an plain object (not another LIPS type)."),
// ------------------------------------------------------------------
flatten: doc('flatten', function flatten(list) {
typecheck('flatten', list, 'pair');
return list.flatten();
- }, "(flatten list)\n\n Return shallow list from tree structure (pairs)."),
+ }, "(flatten list)\n\n Returns a shallow list from tree structure (pairs)."),
// ------------------------------------------------------------------
'array->list': doc('array->list', function (array) {
typecheck('array->list', array, 'array');
return Pair.fromArray(array);
- }, "(array->list array)\n\n Function convert JavaScript array to LIPS list."),
+ }, "(array->list array)\n\n Function that converts a JavaScript array to a LIPS cons list."),
// ------------------------------------------------------------------
- 'tree->array': doc('tree->array', to_array('tree->array', true), "(tree->array list)\n\n Function convert LIPS list structure into JavaScript array."),
+ 'tree->array': doc('tree->array', to_array('tree->array', true), "(tree->array list)\n\n Function that converts a LIPS cons tree structure into a JavaScript array."),
// ------------------------------------------------------------------
- 'list->array': doc('list->array', to_array('list->array'), "(list->array list)\n\n Function convert LIPS list into JavaScript array."),
+ 'list->array': doc('list->array', to_array('list->array'), "(list->array list)\n\n Function that converts a LIPS list into a JavaScript array."),
// ------------------------------------------------------------------
apply: doc('apply', function apply(fn) {
for (var _len29 = arguments.length, args = new Array(_len29 > 1 ? _len29 - 1 : 0), _key29 = 1; _key29 < _len29; _key29++) {
@@ -16488,7 +17375,7 @@
typecheck('apply', last, ['pair', 'nil'], args.length + 2);
args = args.concat(global_env.get('list->array').call(this, last));
return fn.apply(this, prepare_fn_args(fn, args));
- }, "(apply fn list)\n\n Function that call function with list of arguments."),
+ }, "(apply fn list)\n\n Function that calls fn with the list of arguments."),
// ------------------------------------------------------------------
length: doc('length', function length(obj) {
if (!obj || obj === _nil) {
@@ -16502,7 +17389,7 @@
if ("length" in obj) {
return obj.length;
}
- }, "(length expression)\n\n Function return length of the object, the object can be list\n or any object that have length property."),
+ }, "(length expression)\n\n Function that returns the length of the object. The object can be a LIPS\n list or any object that has a \"length\" property. Returns undefined if the\n length could not be found."),
// ------------------------------------------------------------------
'string->number': doc('string->number', function (arg) {
var radix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
@@ -16528,7 +17415,7 @@
}
return false;
- }, "(string->number number [radix])\n\n Function convert string to number."),
+ }, "(string->number number [radix])\n\n Function that parses a string into a number."),
// ------------------------------------------------------------------
'try': doc(new Macro('try', function (code, _ref39) {
var _this24 = this;
@@ -16603,14 +17490,14 @@
_next(result, resolve);
}
});
- }), "(try expr (catch (e) code))\n (try expr (catch (e) code) (finally code))\n (try expr (finally code))\n\n Macro execute user code and catch exception. If catch is provided\n it's executed when expression expr throw error. If finally is provide\n it's always executed at the end."),
+ }), "(try expr (catch (e) code))\n (try expr (catch (e) code) (finally code))\n (try expr (finally code))\n\n Macro that executes expr and catches any exceptions thrown. If catch is provided\n it's executed when an error is thrown. If finally is provided it's always\n executed at the end."),
// ------------------------------------------------------------------
'raise': doc('raise', function (obj) {
throw obj;
- }, "(raise obj)\n\n Throws new exception with given object."),
+ }, "(raise obj)\n\n Throws the object verbatim (no wrapping an a new Error)."),
'throw': doc('throw', function (message) {
throw new Error(message);
- }, "(throw string)\n\n Throws new expection."),
+ }, "(throw string)\n\n Throws a new exception."),
// ------------------------------------------------------------------
find: doc('find', function find(arg, list) {
typecheck('find', arg, ['regex', 'function']);
@@ -16628,7 +17515,7 @@
return find(arg, list.cdr);
});
- }, "(find fn list)\n (find regex list)\n\n Higher order Function find first value for which function return true.\n If called with regex it will create matcher function."),
+ }, "(find fn list)\n (find regex list)\n\n Higher-order function that finds the first value for which fn return true.\n If called with a regex it will create a matcher function."),
// ------------------------------------------------------------------
'for-each': doc('for-each', function (fn) {
var _global_env$get2;
@@ -16650,7 +17537,7 @@
if (is_promise(ret)) {
return ret.then(function () {});
}
- }, "(for-each fn . lists)\n\n Higher order function that call function `fn` by for each\n value of the argument. If you provide more then one list as argument\n it will take each value from each list and call `fn` function\n with that many argument as number of list arguments."),
+ }, "(for-each fn . lists)\n\n Higher-order function that calls function `fn` on each\n value of the argument. If you provide more than one list\n it will take each value from each list and call `fn` function\n with that many arguments as number of list arguments."),
// ------------------------------------------------------------------
map: doc('map', function map(fn) {
var _this25 = this;
@@ -16692,7 +17579,7 @@
return new Pair(head, rest);
});
});
- }, "(map fn . lists)\n\n Higher order function that call function `fn` by for each\n value of the argument. If you provide more then one list as argument\n it will take each value from each list and call `fn` function\n with that many argument as number of list arguments. The return\n values of the function call is acumulated in result list and\n returned by the call to map."),
+ }, "(map fn . lists)\n\n Higher-order function that calls function `fn` with each\n value of the list. If you provide more then one list as argument\n it will take each value from each list and call `fn` function\n with that many argument as number of list arguments. The return\n values of the fn calls are accumulated in a result list and\n returned by map."),
// ------------------------------------------------------------------
'list?': doc('list?', function (obj) {
var node = obj;
@@ -16712,7 +17599,7 @@
node = node.cdr;
}
- }, "(list? obj)\n\n Function test if value is proper linked list structure.\n The car of each pair can be any value. It return false on cycles.\""),
+ }, "(list? obj)\n\n Predicate that tests if value is a proper linked list structure.\n The car of each pair can be any value. It returns false on cyclic lists.\""),
// ------------------------------------------------------------------
some: doc('some', function some(fn, list) {
typecheck('some', fn, 'function');
@@ -16725,7 +17612,7 @@
return value || some(fn, list.cdr);
});
}
- }, "(some fn list)\n\n Higher order function that call argument on each element of the list.\n It stops when function fn return true for a value if so it will\n return true. If none of the values give true, the function return false"),
+ }, "(some fn list)\n\n Higher-order function that calls fn on each element of the list.\n It stops and returns true when fn returns true for a value.\n If none of the values give true, some will return false.\n Analogous to Python any(map(fn, list))."),
// ------------------------------------------------------------------
fold: doc('fold', fold('fold', function (fold, fn, init) {
for (var _len32 = arguments.length, lists = new Array(_len32 > 3 ? _len32 - 3 : 0), _key32 = 3; _key32 < _len32; _key32++) {
@@ -16751,7 +17638,7 @@
return l.car;
})).concat([value]));
});
- }), "(fold fn init . lists)\n\n Function fold is reverse of the reduce. it call function `fn`\n on each elements of the list and return single value.\n e.g. it call (fn a1 b1 (fn a2 b2 (fn a3 b3 '())))\n for: (fold fn '() alist blist)"),
+ }), "(fold fn init . lists)\n\n Function fold is left-to-right reversal of reduce. It call `fn`\n on each pair of elements of the list and returns a single value.\n e.g. it computes (fn 'a 'x (fn 'b 'y (fn 'c 'z 'foo)))\n for: (fold fn 'foo '(a b c) '(x y z))"),
// ------------------------------------------------------------------
pluck: doc('pluck', function pluck() {
for (var _len33 = arguments.length, keys = new Array(_len33), _key33 = 0; _key33 < _len33; _key33++) {
@@ -16779,7 +17666,7 @@
});
return result;
};
- }, "(pluck . string)\n\n If called with single string it will return function that will return\n key from object. If called with more then one argument function will\n return new object by taking all properties from given object."),
+ }, "(pluck . strings)\n\n If called with a single string it will return a function that when\n called with an object will return that key from the object.\n If called with more then one string the returned function will\n create a new object by copying all properties from the given object."),
// ------------------------------------------------------------------
reduce: doc('reduce', fold('reduce', function (reduce, fn, init) {
var _this26 = this;
@@ -16806,7 +17693,7 @@
return l.cdr;
}))));
});
- }), "(reduce fn init list . lists)\n\n Higher order function take each element of the list and call\n the function with result of previous call or init and next element\n on the list until each element is processed and return single value\n as result of last call to `fn` function.\n e.g. it call (fn a3 b3 (fn a2 b2 (fn a1 b1 init)))\n for (reduce fn init alist blist)"),
+ }), "(reduce fn init list . lists)\n\n Higher-order function that takes each element of the list and calls\n the fn with result of previous call or init and the next element\n of the list until each element is processed, and returns a single value\n as result of last call to `fn` function.\n e.g. it computes (fn 'c 'z (fn 'b 'y (fn 'a 'x 'foo)))\n for: (reduce fn 'foo '(a b c) '(x y z))"),
// ------------------------------------------------------------------
filter: doc('filter', function filter(arg, list) {
typecheck('filter', arg, ['regex', 'function']);
@@ -16830,11 +17717,11 @@
var item = array[i];
return unpromise(fn(item), next);
}(0);
- }, "(filter fn list)\n (filter regex list)\n\n Higher order function that call `fn` for each element of the list\n and return list for only those elements for which funtion return\n true value. If called with regex it will create matcher function."),
+ }, "(filter fn list)\n (filter regex list)\n\n Higher-order function that calls `fn` for each element of the list\n and return a new list for only those elements for which fn returns\n a truthy value. If called with a regex it will create a matcher function."),
// ------------------------------------------------------------------
- compose: doc(compose, "(compose . fns)\n\n Higher order function and create new function that apply all functions\n From right to left and return it's value. Reverse of compose.\n e.g.:\n ((compose (curry + 2) (curry * 3)) 3)\n 11\n "),
- pipe: doc(pipe, "(pipe . fns)\n\n Higher order function and create new function that apply all functions\n From left to right and return it's value. Reverse of compose.\n e.g.:\n ((pipe (curry + 2) (curry * 3)) 3)\n 15"),
- curry: doc(curry, "(curry fn . args)\n\n Higher order function that create curried version of the function.\n The result function will have parially applied arguments and it\n will keep returning functions until all arguments are added\n\n e.g.:\n (define (add a b c d) (+ a b c d))\n (define add1 (curry add 1))\n (define add12 (add 2))\n (display (add12 3 4))"),
+ compose: doc(compose, "(compose . fns)\n\n Higher-order function that creates a new function that applies all functions\n from right to left and returns the last value. Reverse of pipe.\n e.g.:\n ((compose (curry + 2) (curry * 3)) 10) --> (+ 2 (* 3 10)) --> 32"),
+ pipe: doc(pipe, "(pipe . fns)\n\n Higher-order function that creates a new function that applies all functions\n from left to right and returns the last value. Reverse of compose.\n e.g.:\n ((pipe (curry + 2) (curry * 3)) 10) --> (* 3 (+ 2 10)) --> 36"),
+ curry: doc(curry, "(curry fn . args)\n\n Higher-order function that creates a curried version of the function.\n The result function will have partially applied arguments and it\n will keep returning one-argument functions until all arguments are provided,\n then it calls the original function with the accumulated arguments.\n\n e.g.:\n (define (add a b c d) (+ a b c d))\n (define add1 (curry add 1))\n (define add12 (add 2))\n (display (add12 3 4))"),
// ------------------------------------------------------------------
// Numbers
// ------------------------------------------------------------------
@@ -16847,7 +17734,7 @@
return args.reduce(function (result, item) {
return result.gcd(item);
});
- }, "(gcd n1 n2 ...)\n\n Function return the greatest common divisor of their arguments."),
+ }, "(gcd n1 n2 ...)\n\n Function that returns the greatest common divisor of the arguments."),
// ------------------------------------------------------------------
lcm: doc('lcm', function lcm() {
for (var _len36 = arguments.length, args = new Array(_len36), _key37 = 0; _key37 < _len36; _key37++) {
@@ -16871,24 +17758,24 @@
}
return LNumber(a);
- }, "(lcm n1 n2 ...)\n\n Function return the least common multiple of their arguments."),
+ }, "(lcm n1 n2 ...)\n\n Function that returns the least common multiple of the arguments."),
// ------------------------------------------------------------------
'odd?': doc('odd?', single_math_op(function (num) {
return LNumber(num).isOdd();
- }), "(odd? number)\n\n Function check if number os odd."),
+ }), "(odd? number)\n\n Checks if number is odd."),
// ------------------------------------------------------------------
'even?': doc('even?', single_math_op(function (num) {
return LNumber(num).isEven();
- }), "(even? number)\n\n Function check if number is even."),
+ }), "(even? number)\n\n Checks if number is even."),
// ------------------------------------------------------------------
// math functions
'*': doc('*', reduce_math_op(function (a, b) {
return LNumber(a).mul(b);
- }, LNumber(1)), "(* . numbers)\n\n Multiplicate all numbers passed as arguments. If single value is passed\n it will return that value."),
+ }, LNumber(1)), "(* . numbers)\n\n Multiplies all numbers passed as arguments. If single value is passed\n it will return that value."),
// ------------------------------------------------------------------
'+': doc('+', reduce_math_op(function (a, b) {
return LNumber(a).add(b);
- }, LNumber(0)), "(+ . numbers)\n\n Sum all numbers passed as arguments. If single value is passed it will\n return that value."),
+ }, LNumber(0)), "(+ . numbers)\n\n Sums all numbers passed as arguments. If single value is passed it will\n return that value."),
// ------------------------------------------------------------------
'-': doc('-', function () {
for (var _len37 = arguments.length, args = new Array(_len37), _key38 = 0; _key38 < _len37; _key38++) {
@@ -16910,7 +17797,7 @@
return LNumber(a).sub(b);
}));
}
- }, "(- n1 n2 ...)\n (- n)\n\n Substract number passed as argument. If only one argument is passed\n it will negate the value."),
+ }, "(- n1 n2 ...)\n (- n)\n\n Subtracts n2 and subsequent numbers from n1. If only one argument is passed\n it will negate the value."),
// ------------------------------------------------------------------
'/': doc('/', function () {
for (var _len38 = arguments.length, args = new Array(_len38), _key39 = 0; _key39 < _len38; _key39++) {
@@ -16930,11 +17817,11 @@
return args.reduce(binary_math_op(function (a, b) {
return LNumber(a).div(b);
}));
- }, "(/ n1 n2 ...)\n (/ n)\n\n Divide number passed as arguments one by one. If single argument\n is passed it will calculate (/ 1 n1)."),
+ }, "(/ n1 n2 ...)\n (/ n)\n\n Divides n1 by n2 and subsequent arguments one by one. If single argument\n is passed it will calculate (/ 1 n)."),
// ------------------------------------------------------------------
abs: doc('abs', single_math_op(function (n) {
return LNumber(n).abs();
- }), "(abs number)\n\n Function create absolute value from number."),
+ }), "(abs number)\n\n Function that returns the absolute value (magnitude) of number."),
// ------------------------------------------------------------------
truncate: doc('truncate', function (n) {
typecheck('truncate', n, 'number');
@@ -16948,11 +17835,11 @@
}
return n;
- }, "(truncate n)\n\n Function return integer value from real number."),
+ }, "(truncate n)\n\n Function that returns the integer part (floor) of a real number."),
// ------------------------------------------------------------------
sqrt: doc('sqrt', single_math_op(function (n) {
return LNumber(n).sqrt();
- }), "(sqrt number)\n\n Function return square root of the number."),
+ }), "(sqrt number)\n\n Function that returns the square root of the number."),
// ------------------------------------------------------------------
'**': doc('**', binary_math_op(function (a, b) {
a = LNumber(a);
@@ -16963,20 +17850,20 @@
}
return a.pow(b);
- }), "(** a b)\n\n Function calculate number a to to the power of b."),
+ }), "(** a b)\n\n Function that calculates number a to to the power of b."),
// ------------------------------------------------------------------
'1+': doc('1+', single_math_op(function (number) {
return LNumber(number).add(1);
- }), "(1+ number)\n\n Function add 1 to the number and return result."),
+ }), "(1+ number)\n\n Function that adds 1 to the number and return result."),
// ------------------------------------------------------------------
'1-': doc(single_math_op(function (number) {
return LNumber(number).sub(1);
- }), "(1- number)\n\n Function substract 1 from the number and return result."),
+ }), "(1- number)\n\n Function that subtracts 1 from the number and return result."),
// ------------------------------------------------------------------
'%': doc('%', function (a, b) {
typecheck_args('%', [a, b], 'number');
return LNumber(a).rem(b);
- }, "(% n1 n2)\n\n Function get reminder of it's arguments."),
+ }, "(% n1 n2)\n\n Function returns the remainder of n1/n2 (modulo)."),
// ------------------------------------------------------------------
// Booleans
'==': doc('==', function () {
@@ -16988,7 +17875,7 @@
return seq_compare(function (a, b) {
return LNumber(a).cmp(b) === 0;
}, args);
- }, "(== x1 x2 ...)\n\n Function compare its numerical arguments and check if they are equal"),
+ }, "(== x1 x2 ...)\n\n Function that compares its numerical arguments and checks if they are\n all equal."),
// ------------------------------------------------------------------
'>': doc('>', function () {
for (var _len40 = arguments.length, args = new Array(_len40), _key41 = 0; _key41 < _len40; _key41++) {
@@ -16999,7 +17886,7 @@
return seq_compare(function (a, b) {
return LNumber(a).cmp(b) === 1;
}, args);
- }, "(> x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically increasing"),
+ }, "(> x1 x2 x3 ...)\n\n Function that compares its numerical arguments and checks if they are\n monotonically decreasing, i.e. x1 > x2 and x2 > x3 and so on."),
// ------------------------------------------------------------------
'<': doc('<', function () {
for (var _len41 = arguments.length, args = new Array(_len41), _key42 = 0; _key42 < _len41; _key42++) {
@@ -17010,7 +17897,7 @@
return seq_compare(function (a, b) {
return LNumber(a).cmp(b) === -1;
}, args);
- }, "(< x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically decreasing"),
+ }, "(< x1 x2 ...)\n\n Function that compares its numerical arguments and checks if they are\n monotonically increasing, i.e. x1 < x2 and x2 < x3 and so on."),
// ------------------------------------------------------------------
'<=': doc('<=', function () {
for (var _len42 = arguments.length, args = new Array(_len42), _key43 = 0; _key43 < _len42; _key43++) {
@@ -17021,7 +17908,7 @@
return seq_compare(function (a, b) {
return [0, -1].includes(LNumber(a).cmp(b));
}, args);
- }, "(<= x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically nonincreasing"),
+ }, "(<= x1 x2 ...)\n\n Function that compares its numerical arguments and checks if they are\n monotonically nondecreasing, i.e. x1 <= x2 and x2 <= x3 and so on."),
// ------------------------------------------------------------------
'>=': doc('>=', function () {
for (var _len43 = arguments.length, args = new Array(_len43), _key44 = 0; _key44 < _len43; _key44++) {
@@ -17032,9 +17919,9 @@
return seq_compare(function (a, b) {
return [0, 1].includes(LNumber(a).cmp(b));
}, args);
- }, "(>= x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically nondecreasing"),
+ }, "(>= x1 x2 ...)\n\n Function that compares its numerical arguments and checks if they are\n monotonically nonincreasing, i.e. x1 >= x2 and x2 >= x3 and so on."),
// ------------------------------------------------------------------
- 'eq?': doc('eq?', equal, "(eq? a b)\n\n Function compare two values if they are identical."),
+ 'eq?': doc('eq?', equal, "(eq? a b)\n\n Function that compares two values if they are identical."),
// ------------------------------------------------------------------
or: doc(new Macro('or', function (code, _ref40) {
var dynamic_scope = _ref40.dynamic_scope,
@@ -17080,7 +17967,7 @@
return unpromise(value, next);
}
}();
- }), "(or . expressions)\n\n Macro execute the values one by one and return the one that is truthy value.\n If there are no expression that evaluate to true it return false."),
+ }), "(or . expressions)\n\n Macro that executes the values one by one and returns the first that is\n a truthy value. If there are no expressions that evaluate to true it\n returns false."),
// ------------------------------------------------------------------
and: doc(new Macro('and', function (code) {
var _ref41 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
@@ -17128,42 +18015,42 @@
return unpromise(value, next);
}
}();
- }), "(and . expressions)\n\n Macro evalute each expression in sequence if any value return false it will\n return false. If each value return true it will return the last value.\n If it's called without arguments it will return true."),
+ }), "(and . expressions)\n\n Macro that evaluates each expression in sequence and if any value returns false\n it will stop and return false. If each value returns true it will return the\n last value. If it's called without arguments it will return true."),
// bit operations
'|': doc('|', function (a, b) {
return LNumber(a).or(b);
- }, "(| a b)\n\n Function calculate or bit operation."),
+ }, "(| a b)\n\n Function that calculates the bitwise or operation."),
'&': doc('&', function (a, b) {
return LNumber(a).and(b);
- }, "(& a b)\n\n Function calculate and bit operation."),
+ }, "(& a b)\n\n Function that calculates the bitwise and operation."),
'~': doc('~', function (a) {
return LNumber(a).neg();
- }, "(~ number)\n\n Function negate the value."),
+ }, "(~ number)\n\n Function that calculates the bitwise inverse (flip all the bits)."),
'>>': doc('>>', function (a, b) {
return LNumber(a).shr(b);
- }, "(>> a b)\n\n Function right shit the value a by value b."),
+ }, "(>> a b)\n\n Function that right shifts the value a by value b bits."),
'<<': doc('<<', function (a, b) {
return LNumber(a).shl(b);
- }, "(<< a b)\n\n Function left shit the value a by value b."),
+ }, "(<< a b)\n\n Function that left shifts the value a by value b bits."),
not: doc('not', function not(value) {
if (is_null(value)) {
return true;
}
return !value;
- }, "(not object)\n\n Function return negation of the argument.")
+ }, "(not object)\n\n Function that returns the Boolean negation of its argument.")
}, undefined, 'global');
var user_env = global_env.inherit('user-env'); // -------------------------------------------------------------------------
function set_interaction_env(interaction, internal) {
interaction.constant('**internal-env**', internal);
- interaction.doc('**internal-env**', "**internal-env**\n\n Constant used to hide stdin, stdout and stderr so they don't interfere\n with variables with the same name. Constants are internal type\n of variables that can't be redefined, defining variable with same name\n will throw an error.");
+ interaction.doc('**internal-env**', "**internal-env**\n\n Constant used to hide stdin, stdout and stderr so they don't interfere\n with variables with the same name. Constants are an internal type\n of variable that can't be redefined, defining a variable with the same name\n will throw an error.");
global_env.set('**interaction-environment**', interaction);
} // -------------------------------------------------------------------------
set_interaction_env(user_env, internal_env);
- global_env.doc('**interaction-environment**', "**interaction-environment**\n\n Internal dynamic, global variable used to find interpreter environment.\n It's used so the read and write functions can locate **internal-env**\n that contain references to stdin, stdout and stderr."); // -------------------------------------------------------------------------
+ global_env.doc('**interaction-environment**', "**interaction-environment**\n\n Internal dynamic, global variable used to find interpreter environment.\n It's used so the read and write functions can locate **internal-env**\n that contains the references to stdin, stdout and stderr."); // -------------------------------------------------------------------------
(function () {
var map = {
@@ -17177,7 +18064,7 @@
if (value instanceof LNumber) {
return value[fn]();
}
- }, "(".concat(name, " number)\n\n Function calculate ").concat(name, " of a number.")));
+ }, "(".concat(name, " number)\n\n Function that calculates the ").concat(name, " of a number.")));
});
})(); // -------------------------------------------------------------------------
// ref: https://stackoverflow.com/a/4331218/387194
@@ -17237,7 +18124,7 @@
return list.cdr;
}
}, arg);
- }, "(".concat(name, " arg)\n\n Function calculate ").concat(code)));
+ }, "(".concat(name, " arg)\n\n Function that calculates ").concat(code)));
}); // -----------------------------------------------------------------------------
function reversseFind(dir, fn) {
@@ -17273,30 +18160,30 @@
function _node_specific() {
- _node_specific = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee21() {
+ _node_specific = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
var _yield$import, createRequire, moduleURL, __dirname, __filename;
- return regenerator.wrap(function _callee21$(_context22) {
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
while (1) {
- switch (_context22.prev = _context22.next) {
+ switch (_context23.prev = _context23.next) {
case 0:
- _context22.next = 2;
+ _context23.next = 2;
return Promise.resolve().then(function () { return empty$1; });
case 2:
- _yield$import = _context22.sent;
+ _yield$import = _context23.sent;
createRequire = _yield$import.createRequire;
nodeRequire = createRequire((typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('lips.js', document.baseURI).href)));
- _context22.next = 7;
+ _context23.next = 7;
return Promise.resolve().then(function () { return empty$1; });
case 7:
- fs = _context22.sent;
- _context22.next = 10;
+ fs = _context23.sent;
+ _context23.next = 10;
return Promise.resolve().then(function () { return path$1; });
case 10:
- path$2 = _context22.sent;
+ path$2 = _context23.sent;
global_env.set('global', global);
global_env.set('self', global);
global_env.set('window', undefined);
@@ -17310,7 +18197,7 @@
typecheck('require.resolve', path, 'string');
var name = path.valueOf();
return nodeRequire.resolve(name);
- }, "(require.resolve path)\n\n Return path relative the current module.")); // ---------------------------------------------------------------------
+ }, "(require.resolve path)\n\n Returns the path relative to the current module.\n\n Only available when LIPS is running under Node.js.")); // ---------------------------------------------------------------------
global_env.set('require', doc('require', function (module) {
typecheck('require', module, 'string');
@@ -17335,14 +18222,14 @@
}
return patch_value(value, global);
- }, "(require module)\n\n Function to be used inside Node.js to import the module."));
+ }, "(require module)\n\n Function used inside Node.js to import a module."));
case 21:
case "end":
- return _context22.stop();
+ return _context23.stop();
}
}
- }, _callee21);
+ }, _callee23);
}));
return _node_specific.apply(this, arguments);
}
@@ -17369,12 +18256,13 @@
}
if (is_function(expected)) {
- return "Invalid type got ".concat(got).concat(postfix);
+ return "Invalid type: got ".concat(got).concat(postfix);
}
if (expected instanceof Array) {
if (expected.length === 1) {
- expected = expected[0];
+ var first = expected[0].toLowerCase();
+ expected = 'a' + ('aeiou'.includes(first) ? 'n ' : ' ') + expected[0];
} else {
var last = expected[expected.length - 1];
expected = expected.slice(0, -1).join(', ') + ' or ' + last;
@@ -17500,8 +18388,8 @@
}
if (_typeof(obj) === 'object') {
- for (var _i4 = 0, _Object$entries2 = Object.entries(type_mapping); _i4 < _Object$entries2.length; _i4++) {
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i4], 2),
+ for (var _i5 = 0, _Object$entries2 = Object.entries(type_mapping); _i5 < _Object$entries2.length; _i5++) {
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i5], 2),
_key45 = _Object$entries2$_i[0],
value = _Object$entries2$_i[1];
@@ -17578,14 +18466,14 @@
}
}
- function promise(_x16) {
+ function promise(_x17) {
return _promise.apply(this, arguments);
}
function _promise() {
- _promise = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee19(node) {
+ _promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(node) {
var pair;
- return regenerator.wrap(function _callee19$(_context20) {
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
while (1) {
switch (_context20.prev = _context20.next) {
case 0:
@@ -17641,7 +18529,7 @@
return _context20.stop();
}
}
- }, _callee19);
+ }, _callee20);
}));
return _promise.apply(this, arguments);
}
@@ -17939,7 +18827,7 @@
if (__promise__ === true && is_promise(result)) {
// fix #139 evaluate the code inside the promise that is not data.
- // When promise is not quoted it happen automatically, when returing
+ // When promise is not quoted it happen automatically, when returning
// promise from evaluate.
result = result.then(function (result) {
if (result instanceof Pair && !value[__data__]) {
@@ -17968,10 +18856,10 @@
function exec_collect(collect_callback) {
return /*#__PURE__*/function () {
- var _exec_lambda = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee20(arg, env, dynamic_scope) {
+ var _exec_lambda = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(arg, env, dynamic_scope) {
var results, input, _iteratorAbruptCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, code, value;
- return regenerator.wrap(function _callee20$(_context21) {
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
while (1) {
switch (_context21.prev = _context21.next) {
case 0:
@@ -18099,10 +18987,10 @@
return _context21.stop();
}
}
- }, _callee20, null, [[5, 29, 33, 43], [34,, 38, 42]]);
+ }, _callee21, null, [[5, 29, 33, 43], [34,, 38, 42]]);
}));
- function exec_lambda(_x17, _x18, _x19) {
+ function exec_lambda(_x18, _x19, _x20) {
return _exec_lambda.apply(this, arguments);
}
@@ -18272,7 +19160,7 @@
if (data.method === 'eval') {
if (!init) {
- send_error('Worker RPC: LIPS not initilized, call init first');
+ send_error('Worker RPC: LIPS not initialized, call init first');
return;
}
@@ -18388,8 +19276,8 @@
var available_class = Object.keys(serialization_map);
var class_map = {};
- for (var _i5 = 0, _Object$entries3 = Object.entries(available_class); _i5 < _Object$entries3.length; _i5++) {
- var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i5], 2),
+ for (var _i6 = 0, _Object$entries3 = Object.entries(available_class); _i6 < _Object$entries3.length; _i6++) {
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i6], 2),
i = _Object$entries3$_i[0],
cls = _Object$entries3$_i[1];
@@ -18472,8 +19360,8 @@
var encoder = new Encoder();
var cbor_serialization_map = {};
- for (var _i6 = 0, _Object$entries4 = Object.entries(serialization_map); _i6 < _Object$entries4.length; _i6++) {
- var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i6], 2),
+ for (var _i7 = 0, _Object$entries4 = Object.entries(serialization_map); _i7 < _Object$entries4.length; _i7++) {
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i7], 2),
name = _Object$entries4$_i[0],
fn = _Object$entries4$_i[1];
@@ -18614,7 +19502,7 @@
function init() {
var lips_mimes = ['text/x-lips', 'text/x-scheme'];
- var bootstraped;
+ var bootstrapped;
function load(script) {
return new Promise(function (resolve) {
@@ -18650,7 +19538,7 @@
if (lips_mimes.includes(type)) {
var bootstrap_attr = script.getAttribute('bootstrap');
- if (!bootstraped && typeof bootstrap_attr === 'string') {
+ if (!bootstrapped && typeof bootstrap_attr === 'string') {
return bootstrap(bootstrap_attr).then(function () {
return load(script);
}).then(loop);
@@ -18675,7 +19563,7 @@
if (typeof bootstrap_attr === 'string') {
return bootstrap(bootstrap_attr).then(function () {
- bootstraped = true;
+ bootstrapped = true;
return loop();
});
}
@@ -18694,10 +19582,10 @@
var banner = function () {
// Rollup tree-shaking is removing the variable if it's normal string because
- // obviously 'Mon, 15 Nov 2021 19:33:52 +0000' == '{{' + 'DATE}}'; can be removed
- // but disablig Tree-shaking is adding lot of not used code so we use this
+ // obviously 'Wed, 22 Nov 2023 13:53:23 +0000' == '{{' + 'DATE}}'; can be removed
+ // but disabling Tree-shaking is adding lot of not used code so we use this
// hack instead
- var date = LString('Mon, 15 Nov 2021 19:33:52 +0000').valueOf();
+ var date = LString('Wed, 22 Nov 2023 13:53:23 +0000').valueOf();
var _date = date === '{{' + 'DATE}}' ? new Date() : new Date(date);
@@ -18709,7 +19597,7 @@
var _build = [_year, _format(_date.getMonth() + 1), _format(_date.getDate())].join('-');
- var banner = "\n __ __ __\n / / \\ \\ _ _ ___ ___ \\ \\\n| | \\ \\ | | | || . \\/ __> | |\n| | > \\ | |_ | || _/\\__ \\ | |\n| | / ^ \\ |___||_||_| <___/ | |\n \\_\\ /_/ \\_\\ /_/\n\nLIPS Interpreter 1.0.0-beta.16 (".concat(_build, ") \nCopyright (c) 2018-").concat(_year, " Jakub T. Jankiewicz\n\nType (env) to see environment with functions macros and variables. You can also\nuse (help name) to display help for specic function or macro, (apropos name)\nto display list of matched names in environment and (dir object) to list\nproperties of an object.\n").replace(/^.*\n/, '');
+ var banner = "\n __ __ __\n / / \\ \\ _ _ ___ ___ \\ \\\n| | \\ \\ | | | || . \\/ __> | |\n| | > \\ | |_ | || _/\\__ \\ | |\n| | / ^ \\ |___||_||_| <___/ | |\n \\_\\ /_/ \\_\\ /_/\n\nLIPS Interpreter DEV (".concat(_build, ") \nCopyright (c) 2018-").concat(_year, " Jakub T. Jankiewicz\n\nType (env) to see environment with functions macros and variables. You can also\nuse (help name) to display help for specific function or macro, (apropos name)\nto display list of matched names in environment and (dir object) to list\nproperties of an object.\n").replace(/^.*\n/, '');
return banner;
}(); // -------------------------------------------------------------------------
// to be used with string function when code is minified
@@ -18741,9 +19629,9 @@
read_only(QuotedPromise, '__class__', 'promise'); // -------------------------------------------------------------------------
var lips = {
- version: '1.0.0-beta.16',
+ version: 'DEV',
banner: banner,
- date: 'Mon, 15 Nov 2021 19:33:52 +0000',
+ date: 'Wed, 22 Nov 2023 13:53:23 +0000',
exec: exec,
// unwrap async generator into Promise
parse: compose(uniterate_async, parse),
diff --git a/dist/lips.js.map b/dist/lips.js.map
new file mode 100644
index 000000000..f72773ca8
--- /dev/null
+++ b/dist/lips.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"lips.js","sources":["../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../node_modules/@babel/runtime/helpers/esm/construct.js","../node_modules/@babel/runtime/helpers/esm/inherits.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../node_modules/@babel/runtime/helpers/esm/toArray.js","../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../node_modules/@babel/runtime/helpers/esm/createClass.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../node_modules/@babel/runtime/helpers/esm/asyncIterator.js","../node_modules/@babel/runtime/helpers/esm/AwaitValue.js","../node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js","../node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js","../node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js","../node_modules/regenerator-runtime/runtime.js","../node_modules/@babel/runtime/regenerator/index.js","../node_modules/rollup-plugin-node-polyfills/polyfills/global.js","../node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js","../node_modules/cbor-x/decode.js","../node_modules/cbor-x/encode.js","../node_modules/lzjb-pack/index.cjs","../node_modules/unfetch/dist/unfetch.module.js","../src/lips.js","../node_modules/rollup-plugin-node-polyfills/polyfills/empty.js","../node_modules/rollup-plugin-node-polyfills/polyfills/path.js"],"sourcesContent":["export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _asyncIterator(iterable) {\n var method;\n\n if (typeof Symbol !== \"undefined\") {\n if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];\n if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];\n }\n\n if (method == null) method = iterable[\"@@asyncIterator\"];\n if (method == null) method = iterable[\"@@iterator\"];\n if (method == null) throw new TypeError(\"Object is not async iterable\");\n return method.call(iterable);\n}","export default function _AwaitValue(value) {\n this.wrapped = value;\n}","import AwaitValue from \"./AwaitValue.js\";\nexport default function _awaitAsyncGenerator(value) {\n return new AwaitValue(value);\n}","import AwaitValue from \"./AwaitValue.js\";\nexport default function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg);\n var value = result.value;\n var wrappedAwait = value instanceof AwaitValue;\n Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) {\n if (wrappedAwait) {\n resume(key === \"return\" ? \"return\" : \"next\", arg);\n return;\n }\n\n settle(result.done ? \"return\" : \"normal\", arg);\n }, function (err) {\n resume(\"throw\", err);\n });\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case \"return\":\n front.resolve({\n value: value,\n done: true\n });\n break;\n\n case \"throw\":\n front.reject(value);\n break;\n\n default:\n front.resolve({\n value: value,\n done: false\n });\n break;\n }\n\n front = front.next;\n\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n if (typeof gen[\"return\"] !== \"function\") {\n this[\"return\"] = undefined;\n }\n}\n\nAsyncGenerator.prototype[typeof Symbol === \"function\" && Symbol.asyncIterator || \"@@asyncIterator\"] = function () {\n return this;\n};\n\nAsyncGenerator.prototype.next = function (arg) {\n return this._invoke(\"next\", arg);\n};\n\nAsyncGenerator.prototype[\"throw\"] = function (arg) {\n return this._invoke(\"throw\", arg);\n};\n\nAsyncGenerator.prototype[\"return\"] = function (arg) {\n return this._invoke(\"return\", arg);\n};","import AsyncGenerator from \"./AsyncGenerator.js\";\nexport default function _wrapAsyncGenerator(fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n}","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","module.exports = require(\"regenerator-runtime\");\n","export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});","var lookup = [];\nvar revLookup = [];\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\nvar inited = false;\nfunction init () {\n inited = true;\n var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n }\n\n revLookup['-'.charCodeAt(0)] = 62;\n revLookup['_'.charCodeAt(0)] = 63;\n}\n\nfunction toByteArray (b64) {\n if (!inited) {\n init();\n }\n var i, j, l, tmp, placeHolders, arr;\n var len = b64.length;\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;\n\n // base64 is 4/3 + up to two characters of the original data\n arr = new Arr(len * 3 / 4 - placeHolders);\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len;\n\n var L = 0;\n\n for (i = 0, j = 0; i < l; i += 4, j += 3) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)];\n arr[L++] = (tmp >> 16) & 0xFF;\n arr[L++] = (tmp >> 8) & 0xFF;\n arr[L++] = tmp & 0xFF;\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);\n arr[L++] = tmp & 0xFF;\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2);\n arr[L++] = (tmp >> 8) & 0xFF;\n arr[L++] = tmp & 0xFF;\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp;\n var output = [];\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);\n output.push(tripletToBase64(tmp));\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n if (!inited) {\n init();\n }\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n var output = '';\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)));\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n output += lookup[tmp >> 2];\n output += lookup[(tmp << 4) & 0x3F];\n output += '==';\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1]);\n output += lookup[tmp >> 10];\n output += lookup[(tmp >> 4) & 0x3F];\n output += lookup[(tmp << 2) & 0x3F];\n output += '=';\n }\n\n parts.push(output);\n\n return parts.join('')\n}\n\nfunction read (buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? (nBytes - 1) : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n\n i += d;\n\n e = s & ((1 << (-nBits)) - 1);\n s >>= (-nBits);\n nBits += eLen;\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1);\n e >>= (-nBits);\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nfunction write (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0);\n var i = isLE ? 0 : (nBytes - 1);\n var d = isLE ? 1 : -1;\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;\n\n value = Math.abs(value);\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m;\n eLen += mLen;\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128;\n}\n\nvar toString = {}.toString;\n\nvar isArray = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nvar INSPECT_MAX_BYTES = 50;\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : true;\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nvar _kMaxLength = kMaxLength();\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length);\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length);\n }\n that.length = length;\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192; // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype;\n return arr\n};\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n};\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype;\n Buffer.__proto__ = Uint8Array;\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size);\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n};\n\nfunction allocUnsafe (that, size) {\n assertSize(size);\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0;\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n};\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n};\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8';\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0;\n that = createBuffer(that, length);\n\n var actual = that.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual);\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0;\n that = createBuffer(that, length);\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255;\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength; // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array);\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset);\n } else {\n array = new Uint8Array(array, byteOffset, length);\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array;\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array);\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (internalIsBuffer(obj)) {\n var len = checked(obj.length) | 0;\n that = createBuffer(that, len);\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len);\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0;\n }\n return Buffer.alloc(+length)\n}\nBuffer.isBuffer = isBuffer;\nfunction internalIsBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!internalIsBuffer(a) || !internalIsBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n};\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n};\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i;\n if (length === undefined) {\n length = 0;\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n var buffer = Buffer.allocUnsafe(length);\n var pos = 0;\n for (i = 0; i < list.length; ++i) {\n var buf = list[i];\n if (!internalIsBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos);\n pos += buf.length;\n }\n return buffer\n};\n\nfunction byteLength (string, encoding) {\n if (internalIsBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string;\n }\n\n var len = string.length;\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false;\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n}\nBuffer.byteLength = byteLength;\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false;\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0;\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8';\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase();\n loweredCase = true;\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true;\n\nfunction swap (b, n, m) {\n var i = b[n];\n b[n] = b[m];\n b[m] = i;\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length;\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n return this\n};\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length;\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n return this\n};\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length;\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n return this\n};\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0;\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n};\n\nBuffer.prototype.equals = function equals (b) {\n if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n};\n\nBuffer.prototype.inspect = function inspect () {\n var str = '';\n var max = INSPECT_MAX_BYTES;\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');\n if (this.length > max) str += ' ... ';\n }\n return ''\n};\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!internalIsBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0;\n }\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n if (thisStart === undefined) {\n thisStart = 0;\n }\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart;\n var y = end - start;\n var len = Math.min(x, y);\n\n var thisCopy = this.slice(thisStart, thisEnd);\n var targetCopy = target.slice(start, end);\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n};\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n byteOffset = +byteOffset; // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1);\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1;\n var arrLength = arr.length;\n var valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i;\n if (dir) {\n var foundIndex = -1;\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n for (i = byteOffset; i >= 0; i--) {\n var found = true;\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n};\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n};\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n};\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0;\n var remaining = buf.length - offset;\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n if (length > remaining) {\n length = remaining;\n }\n }\n\n // must be an even number of digits\n var strLen = string.length;\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16);\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed;\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8';\n length = this.length;\n offset = 0;\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset;\n length = this.length;\n offset = 0;\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0;\n if (isFinite(length)) {\n length = length | 0;\n if (encoding === undefined) encoding = 'utf8';\n } else {\n encoding = length;\n length = undefined;\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8';\n\n var loweredCase = false;\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n};\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n};\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return fromByteArray(buf)\n } else {\n return fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end);\n var res = [];\n\n var i = start;\n while (i < end) {\n var firstByte = buf[i];\n var codePoint = null;\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1;\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte;\n }\n break\n case 2:\n secondByte = buf[i + 1];\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F);\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint;\n }\n }\n break\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F);\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint;\n }\n }\n break\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F);\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint;\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD;\n bytesPerSequence = 1;\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000;\n res.push(codePoint >>> 10 & 0x3FF | 0xD800);\n codePoint = 0xDC00 | codePoint & 0x3FF;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000;\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length;\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = '';\n var i = 0;\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n );\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F);\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length;\n\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n\n var out = '';\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i]);\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end);\n var res = '';\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n\n var newBuf;\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end);\n newBuf.__proto__ = Buffer.prototype;\n } else {\n var sliceLen = end - start;\n newBuf = new Buffer(sliceLen, undefined);\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start];\n }\n }\n\n return newBuf\n};\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n\n var val = this[offset];\n var mul = 1;\n var i = 0;\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n return val\n};\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n var val = this[offset + --byteLength];\n var mul = 1;\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val\n};\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset]\n};\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | (this[offset + 1] << 8)\n};\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return (this[offset] << 8) | this[offset + 1]\n};\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n};\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n};\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n\n var val = this[offset];\n var mul = 1;\n var i = 0;\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n mul *= 0x80;\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n\n return val\n};\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n\n var i = byteLength;\n var mul = 1;\n var val = this[offset + --i];\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul;\n }\n mul *= 0x80;\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n\n return val\n};\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n};\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset] | (this[offset + 1] << 8);\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n};\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset + 1] | (this[offset] << 8);\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n};\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n};\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n};\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return read(this, offset, true, 23, 4)\n};\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return read(this, offset, false, 23, 4)\n};\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return read(this, offset, true, 52, 8)\n};\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return read(this, offset, false, 52, 8)\n};\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!internalIsBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var mul = 1;\n var i = 0;\n this[offset] = value & 0xFF;\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF;\n }\n\n return offset + byteLength\n};\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n this[offset + i] = value & 0xFF;\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF;\n }\n\n return offset + byteLength\n};\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n this[offset] = (value & 0xff);\n return offset + 1\n};\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1;\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8;\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff);\n this[offset + 1] = (value >>> 8);\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n return offset + 2\n};\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8);\n this[offset + 1] = (value & 0xff);\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n return offset + 2\n};\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1;\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff;\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24);\n this[offset + 2] = (value >>> 16);\n this[offset + 1] = (value >>> 8);\n this[offset] = (value & 0xff);\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n return offset + 4\n};\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24);\n this[offset + 1] = (value >>> 16);\n this[offset + 2] = (value >>> 8);\n this[offset + 3] = (value & 0xff);\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n return offset + 4\n};\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = 0;\n var mul = 1;\n var sub = 0;\n this[offset] = value & 0xFF;\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength\n};\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n var sub = 0;\n this[offset + i] = value & 0xFF;\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength\n};\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n if (value < 0) value = 0xff + value + 1;\n this[offset] = (value & 0xff);\n return offset + 1\n};\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff);\n this[offset + 1] = (value >>> 8);\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n return offset + 2\n};\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8);\n this[offset + 1] = (value & 0xff);\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n return offset + 2\n};\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff);\n this[offset + 1] = (value >>> 8);\n this[offset + 2] = (value >>> 16);\n this[offset + 3] = (value >>> 24);\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n return offset + 4\n};\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n if (value < 0) value = 0xffffffff + value + 1;\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24);\n this[offset + 1] = (value >>> 16);\n this[offset + 2] = (value >>> 8);\n this[offset + 3] = (value & 0xff);\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n return offset + 4\n};\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4);\n }\n write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n};\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n};\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8);\n }\n write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n};\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n};\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start;\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length;\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n var len = end - start;\n var i;\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start];\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start];\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n );\n }\n\n return len\n};\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === 'string') {\n encoding = end;\n end = this.length;\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0);\n if (code < 256) {\n val = code;\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255;\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n\n if (!val) val = 0;\n\n var i;\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n var bytes = internalIsBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString());\n var len = bytes.length;\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this\n};\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g;\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '');\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '=';\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity;\n var codePoint;\n var length = string.length;\n var leadSurrogate = null;\n var bytes = [];\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i);\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint;\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n leadSurrogate = codePoint;\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n }\n\n leadSurrogate = null;\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n );\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n );\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n );\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = [];\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF);\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo;\n var byteArray = [];\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray\n}\n\n\nfunction base64ToBytes (str) {\n return toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i];\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n\n// the following is from is-buffer, also by Feross Aboukhadijeh and with same licence\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nfunction isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}\n\nfunction isFastBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))\n}\n\nexport { Buffer, INSPECT_MAX_BYTES, SlowBuffer, isBuffer, _kMaxLength as kMaxLength };\n","\"use strict\"\r\nlet decoder\r\ntry {\r\n\tdecoder = new TextDecoder()\r\n} catch(error) {}\r\nlet src\r\nlet srcEnd\r\nlet position = 0\r\nlet alreadySet\r\nconst EMPTY_ARRAY = []\r\nconst RECORD_TAG_ID = 0x69\r\nconst STOP_CODE = {}\r\nlet strings = EMPTY_ARRAY\r\nlet stringPosition = 0\r\nlet currentDecoder = {}\r\nlet currentStructures\r\nlet srcString\r\nlet srcStringStart = 0\r\nlet srcStringEnd = 0\r\nlet referenceMap\r\nlet currentExtensions = []\r\nlet dataView\r\nlet restoreMapsAsObject\r\nlet defaultOptions = {\r\n\tuseRecords: false,\r\n\tmapsAsObjects: true\r\n}\r\nlet sequentialMode = false\r\n\r\nexport class Decoder {\r\n\tconstructor(options) {\r\n\t\tif (options) {\r\n\t\t\tif (options.useRecords === false && options.mapsAsObjects === undefined)\r\n\t\t\t\toptions.mapsAsObjects = true\r\n\t\t\tif (options.getStructures && !options.structures)\r\n\t\t\t\t(options.structures = []).uninitialized = true // this is what we use to denote an uninitialized structures\r\n\t\t}\r\n\t\tObject.assign(this, options)\r\n\t}\r\n\tdecode(source, end) {\r\n\t\tif (src) {\r\n\t\t\t// re-entrant execution, save the state and restore it after we do this decode\r\n\t\t\treturn saveState(() => {\r\n\t\t\t\tclearSource()\r\n\t\t\t\treturn this ? this.decode(source, end) : Decoder.prototype.decode.call(defaultOptions, source, end)\r\n\t\t\t})\r\n\t\t}\r\n\t\tsrcEnd = end > -1 ? end : source.length\r\n\t\tposition = 0\r\n\t\tstringPosition = 0\r\n\t\tsrcStringEnd = 0\r\n\t\tsrcString = null\r\n\t\tstrings = EMPTY_ARRAY\r\n\t\tsrc = source\r\n\t\t// this provides cached access to the data view for a buffer if it is getting reused, which is a recommend\r\n\t\t// technique for getting data from a database where it can be copied into an existing buffer instead of creating\r\n\t\t// new ones\r\n\t\tdataView = source.dataView || (source.dataView = new DataView(source.buffer, source.byteOffset, source.byteLength))\r\n\t\tif (this) {\r\n\t\t\tcurrentDecoder = this\r\n\t\t\tif (this.structures) {\r\n\t\t\t\tcurrentStructures = this.structures\r\n\t\t\t\treturn checkedRead()\r\n\t\t\t} else if (!currentStructures || currentStructures.length > 0) {\r\n\t\t\t\tcurrentStructures = []\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcurrentDecoder = defaultOptions\r\n\t\t\tif (!currentStructures || currentStructures.length > 0)\r\n\t\t\t\tcurrentStructures = []\r\n\t\t}\r\n\t\treturn checkedRead()\r\n\t}\r\n\tdecodeMultiple(source, forEach) {\r\n\t\tlet values, lastPosition = 0\r\n\t\ttry {\r\n\t\t\tlet size = source.length\r\n\t\t\tsequentialMode = true\r\n\t\t\tlet value = this ? this.decode(source, size) : defaultDecoder.decode(source, size)\r\n\t\t\tif (forEach) {\r\n\t\t\t\tforEach(value)\r\n\t\t\t\twhile(position < size) {\r\n\t\t\t\t\tlastPosition = position\r\n\t\t\t\t\tif (forEach(checkedRead()) === false) {\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tvalues = [ value ]\r\n\t\t\t\twhile(position < size) {\r\n\t\t\t\t\tlastPosition = position\r\n\t\t\t\t\tvalues.push(checkedRead())\r\n\t\t\t\t}\r\n\t\t\t\treturn values\r\n\t\t\t}\r\n\t\t} catch(error) {\r\n\t\t\terror.lastPosition = lastPosition\r\n\t\t\terror.values = values\r\n\t\t\tthrow error\r\n\t\t} finally {\r\n\t\t\tsequentialMode = false\r\n\t\t\tclearSource()\r\n\t\t}\r\n\t}\r\n}\r\nexport function getPosition() {\r\n\treturn position\r\n}\r\nexport function checkedRead() {\r\n\ttry {\r\n\t\tlet result = read()\r\n\t\tif (position == srcEnd) {\r\n\t\t\t// finished reading this source, cleanup references\r\n\t\t\tcurrentStructures = null\r\n\t\t\tsrc = null\r\n\t\t\tif (referenceMap)\r\n\t\t\t\treferenceMap = null\r\n\t\t} else if (position > srcEnd) {\r\n\t\t\t// over read\r\n\t\t\tlet error = new Error('Unexpected end of CBOR data')\r\n\t\t\terror.incomplete = true\r\n\t\t\tthrow error\r\n\t\t} else if (!sequentialMode) {\r\n\t\t\tthrow new Error('Data read, but end of buffer not reached')\r\n\t\t}\r\n\t\t// else more to read, but we are reading sequentially, so don't clear source yet\r\n\t\treturn result\r\n\t} catch(error) {\r\n\t\tclearSource()\r\n\t\tif (error instanceof RangeError || error.message.startsWith('Unexpected end of buffer')) {\r\n\t\t\terror.incomplete = true\r\n\t\t}\r\n\t\tthrow error\r\n\t}\r\n}\r\n\r\nexport function read() {\r\n\tlet token = src[position++]\r\n\tlet majorType = token >> 5\r\n\ttoken = token & 0x1f\r\n\tif (token > 0x17) {\r\n\t\tswitch (token) {\r\n\t\t\tcase 0x18:\r\n\t\t\t\ttoken = src[position++]\r\n\t\t\t\tbreak\r\n\t\t\tcase 0x19:\r\n\t\t\t\tif (majorType == 7) {\r\n\t\t\t\t\treturn getFloat16()\r\n\t\t\t\t}\r\n\t\t\t\ttoken = dataView.getUint16(position)\r\n\t\t\t\tposition += 2\r\n\t\t\t\tbreak\r\n\t\t\tcase 0x1a:\r\n\t\t\t\tif (majorType == 7) {\r\n\t\t\t\t\tlet value = dataView.getFloat32(position)\r\n\t\t\t\t\tif (currentDecoder.useFloat32 > 2) {\r\n\t\t\t\t\t\t// this does rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved\r\n\t\t\t\t\t\tlet multiplier = mult10[((src[position] & 0x7f) << 1) | (src[position + 1] >> 7)]\r\n\t\t\t\t\t\tposition += 4\r\n\t\t\t\t\t\treturn ((multiplier * value + (value > 0 ? 0.5 : -0.5)) >> 0) / multiplier\r\n\t\t\t\t\t}\r\n\t\t\t\t\tposition += 4\r\n\t\t\t\t\treturn value\r\n\t\t\t\t}\r\n\t\t\t\ttoken = dataView.getUint32(position)\r\n\t\t\t\tposition += 4\r\n\t\t\t\tbreak\r\n\t\t\tcase 0x1b:\r\n\t\t\t\tif (majorType == 7) {\r\n\t\t\t\t\tlet value = dataView.getFloat64(position)\r\n\t\t\t\t\tposition += 8\r\n\t\t\t\t\treturn value\r\n\t\t\t\t}\r\n\t\t\t\tif (currentDecoder.uint64AsNumber)\r\n\t\t\t\t\treturn src[position++] * 0x100000000000000 + src[position++] * 0x1000000000000 + src[position++] * 0x10000000000 + src[position++] * 0x100000000 +\r\n\t\t\t\t\t\tsrc[position++] * 0x1000000 + (src[position++] << 16) + (src[position++] << 8) + src[position++]\r\n\t\t\t\ttoken = dataView.getBigUint64(position)\r\n\t\t\t\tposition += 8\r\n\t\t\t\tbreak\r\n\t\t\tcase 0x1f: \r\n\t\t\t\t// indefinite length\r\n\t\t\t\tswitch(majorType) {\r\n\t\t\t\t\tcase 2: // byte string\r\n\t\t\t\t\tcase 3: // text string\r\n\t\t\t\t\tcase 4: // array\r\n\t\t\t\t\t\tlet array = []\r\n\t\t\t\t\t\tlet value, i = 0\r\n\t\t\t\t\t\twhile ((value = read()) != STOP_CODE) {\r\n\t\t\t\t\t\t\tarray[i++] = value\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn majorType == 4 ? array : majorType == 3 ? array.join('') : Buffer.concat(array)\r\n\t\t\t\t\tcase 5: // map\r\n\t\t\t\t\t\tlet key\r\n\t\t\t\t\t\tif (currentDecoder.mapsAsObjects) {\r\n\t\t\t\t\t\t\tlet object = {}\r\n\t\t\t\t\t\t\twhile ((key = readKey()) != STOP_CODE)\r\n\t\t\t\t\t\t\t\tobject[key] = read()\r\n\t\t\t\t\t\t\treturn object\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (restoreMapsAsObject) {\r\n\t\t\t\t\t\t\t\tcurrentDecoder.mapsAsObjects = true\r\n\t\t\t\t\t\t\t\trestoreMapsAsObject = false\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlet map = new Map()\r\n\t\t\t\t\t\t\twhile ((key = read()) != STOP_CODE)\r\n\t\t\t\t\t\t\t\tmap.set(key, read())\r\n\t\t\t\t\t\t\treturn map\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\treturn STOP_CODE\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthrow new Error('Invalid major type for indefinite length ' + majorType)\r\n\t\t\t\t}\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Error('Unknown token ' + token)\r\n\t\t}\r\n\t}\r\n\tswitch (majorType) {\r\n\t\tcase 0: // positive int\r\n\t\t\treturn token\r\n\t\tcase 1: // negative int\r\n\t\t\treturn ~token\r\n\t\tcase 2: // buffer\r\n\t\t\treturn readBin(token)\r\n\t\tcase 3: // string\r\n\t\t\tif (srcStringEnd >= position) {\r\n\t\t\t\treturn srcString.slice(position - srcStringStart, (position += token) - srcStringStart)\r\n\t\t\t}\r\n\t\t\tif (srcStringEnd == 0 && srcEnd < 140 && token < 32) {\r\n\t\t\t\t// for small blocks, avoiding the overhead of the extract call is helpful\r\n\t\t\t\tlet string = token < 16 ? shortStringInJS(token) : longStringInJS(token)\r\n\t\t\t\tif (string != null)\r\n\t\t\t\t\treturn string\r\n\t\t\t}\r\n\t\t\treturn readFixedString(token)\r\n\t\tcase 4: // array\r\n\t\t\tlet array = new Array(token)\r\n\t\t\tfor (let i = 0; i < token; i++) {\r\n\t\t\t\tarray[i] = read()\r\n\t\t\t}\r\n\t\t\treturn array\r\n\t\tcase 5: // map\r\n\t\t\tif (currentDecoder.mapsAsObjects) {\r\n\t\t\t\tlet object = {}\r\n\t\t\t\tfor (let i = 0; i < token; i++) {\r\n\t\t\t\t\tobject[readKey()] = read()\r\n\t\t\t\t}\r\n\t\t\t\treturn object\r\n\t\t\t} else {\r\n\t\t\t\tif (restoreMapsAsObject) {\r\n\t\t\t\t\tcurrentDecoder.mapsAsObjects = true\r\n\t\t\t\t\trestoreMapsAsObject = false\r\n\t\t\t\t}\r\n\t\t\t\tlet map = new Map()\r\n\t\t\t\tfor (let i = 0; i < token; i++) {\r\n\t\t\t\t\tmap.set(read(), read())\r\n\t\t\t\t}\r\n\t\t\t\treturn map\r\n\t\t\t}\r\n\t\tcase 6: // extension\r\n\t\t\tif ((token >> 8) == RECORD_TAG_ID) { // record structures\r\n\t\t\t\tlet structure = currentStructures[token & 0xff]\r\n\t\t\t\tif (structure) {\r\n\t\t\t\t\tif (!structure.read)\r\n\t\t\t\t\t\tstructure.read = createStructureReader(structure)\r\n\t\t\t\t\treturn structure.read()\r\n\t\t\t\t} else if (currentDecoder.getStructures) {\r\n\t\t\t\t\tlet updatedStructures = saveState(() => {\r\n\t\t\t\t\t\t// save the state in case getStructures modifies our buffer\r\n\t\t\t\t\t\tsrc = null\r\n\t\t\t\t\t\treturn currentDecoder.getStructures()\r\n\t\t\t\t\t})\r\n\t\t\t\t\tif (currentStructures === true)\r\n\t\t\t\t\t\tcurrentDecoder.structures = currentStructures = updatedStructures\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcurrentStructures.splice.apply(currentStructures, [0, updatedStructures.length].concat(updatedStructures))\r\n\t\t\t\t\tstructure = currentStructures[token & 0xff]\r\n\t\t\t\t\tif (structure) {\r\n\t\t\t\t\t\tif (!structure.read)\r\n\t\t\t\t\t\t\tstructure.read = createStructureReader(structure)\r\n\t\t\t\t\t\treturn structure.read()\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\treturn token\r\n\t\t\t\t} else\r\n\t\t\t\t\treturn token\r\n\t\t\t} else {\r\n\t\t\t\tlet extension = currentExtensions[token]\r\n\t\t\t\tif (extension) {\r\n\t\t\t\t\tif (extension.handlesRead)\r\n\t\t\t\t\t\treturn extension(read)\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn extension(read())\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\treturn new Tag(read())\r\n\t\t\t}\r\n\t\tcase 7: // fixed value\r\n\t\t\tswitch (token) {\r\n\t\t\t\tcase 0x14: return false\r\n\t\t\t\tcase 0x15: return true\r\n\t\t\t\tcase 0x16: return null\r\n\t\t\t\tcase 0x17: return; // undefined\r\n\t\t\t\tcase 0x1f: \r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error('Unknown token ' + token)\r\n\t\t\t}\r\n\t\tdefault: // negative int\r\n\t\t\tif (isNaN(token)) {\r\n\t\t\t\tlet error = new Error('Unexpected end of CBOR data')\r\n\t\t\t\terror.incomplete = true\r\n\t\t\t\tthrow error\r\n\t\t\t}\r\n\t\t\tthrow new Error('Unknown CBOR token ' + token)\r\n\t}\r\n}\r\nconst validName = /^[a-zA-Z_$][a-zA-Z\\d_$]*$/\r\nfunction createStructureReader(structure) {\r\n\tlet l = structure.length\r\n\tfunction readObject() {\r\n\t\t// This initial function is quick to instantiate, but runs slower. After several iterations pay the cost to build the faster function\r\n\t\tif (readObject.count++ > 2) {\r\n\t\t\tthis.read = (new Function('a', 'r', 'return function(){a();return {' + structure.map(key => validName.test(key) ? key + ':r()' : ('[' + JSON.stringify(key) + ']:r()')).join(',') + '}}'))(readArrayHeader, read)\r\n\t\t\treturn this.read()\r\n\t\t}\r\n\t\treadArrayHeader(l)\r\n\t\tlet object = {}\r\n\t\tfor (let i = 0; i < l; i++) {\r\n\t\t\tlet key = structure[i]\r\n\t\t\tobject[key] = read()\r\n\t\t}\r\n\t\treturn object\r\n\t}\r\n\treadObject.count = 0\r\n\treturn readObject\r\n}\r\n\r\nfunction readArrayHeader(expectedLength) {\r\n\t// consume the array header, TODO: check expected length\r\n\tlet token = src[position++]\r\n\t//let majorType = token >> 5\r\n\ttoken = token & 0x1f\r\n\tif (token > 0x17) {\r\n\t\tswitch (token) {\r\n\t\t\tcase 0x18: position++\r\n\t\t\t\tbreak\r\n\t\t\tcase 0x19: position += 2\r\n\t\t\t\tbreak\r\n\t\t\tcase 0x1a: position += 4\r\n\t\t}\r\n\t}\r\n}\r\n\r\nlet readFixedString = readStringJS\r\nlet readString8 = readStringJS\r\nlet readString16 = readStringJS\r\nlet readString32 = readStringJS\r\n\r\nexport function setExtractor(extractStrings) {\r\n\treadFixedString = readString(1)\r\n\treadString8 = readString(2)\r\n\treadString16 = readString(3)\r\n\treadString32 = readString(5)\r\n\tfunction readString(headerLength) {\r\n\t\treturn function readString(length) {\r\n\t\t\tlet string = strings[stringPosition++]\r\n\t\t\tif (string == null) {\r\n\t\t\t\tlet extraction = extractStrings(position, srcEnd, length, src)\r\n\t\t\t\tif (typeof extraction == 'string') {\r\n\t\t\t\t\tstring = extraction\r\n\t\t\t\t\tstrings = EMPTY_ARRAY\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstrings = extraction\r\n\t\t\t\t\tstringPosition = 1\r\n\t\t\t\t\tsrcStringEnd = 1 // even if a utf-8 string was decoded, must indicate we are in the midst of extracted strings and can't skip strings\r\n\t\t\t\t\tstring = strings[0]\r\n\t\t\t\t\tif (string === undefined)\r\n\t\t\t\t\t\tthrow new Error('Unexpected end of buffer')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlet srcStringLength = string.length\r\n\t\t\tif (srcStringLength <= length) {\r\n\t\t\t\tposition += length\r\n\t\t\t\treturn string\r\n\t\t\t}\r\n\t\t\tsrcString = string\r\n\t\t\tsrcStringStart = position\r\n\t\t\tsrcStringEnd = position + srcStringLength\r\n\t\t\tposition += length\r\n\t\t\treturn string.slice(0, length) // we know we just want the beginning\r\n\t\t}\r\n\t}\r\n}\r\nfunction readStringJS(length) {\r\n\tlet result\r\n\tif (length < 16) {\r\n\t\tif (result = shortStringInJS(length))\r\n\t\t\treturn result\r\n\t}\r\n\tif (length > 64 && decoder)\r\n\t\treturn decoder.decode(src.subarray(position, position += length))\r\n\tconst end = position + length\r\n\tconst units = []\r\n\tresult = ''\r\n\twhile (position < end) {\r\n\t\tconst byte1 = src[position++]\r\n\t\tif ((byte1 & 0x80) === 0) {\r\n\t\t\t// 1 byte\r\n\t\t\tunits.push(byte1)\r\n\t\t} else if ((byte1 & 0xe0) === 0xc0) {\r\n\t\t\t// 2 bytes\r\n\t\t\tconst byte2 = src[position++] & 0x3f\r\n\t\t\tunits.push(((byte1 & 0x1f) << 6) | byte2)\r\n\t\t} else if ((byte1 & 0xf0) === 0xe0) {\r\n\t\t\t// 3 bytes\r\n\t\t\tconst byte2 = src[position++] & 0x3f\r\n\t\t\tconst byte3 = src[position++] & 0x3f\r\n\t\t\tunits.push(((byte1 & 0x1f) << 12) | (byte2 << 6) | byte3)\r\n\t\t} else if ((byte1 & 0xf8) === 0xf0) {\r\n\t\t\t// 4 bytes\r\n\t\t\tconst byte2 = src[position++] & 0x3f\r\n\t\t\tconst byte3 = src[position++] & 0x3f\r\n\t\t\tconst byte4 = src[position++] & 0x3f\r\n\t\t\tlet unit = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0c) | (byte3 << 0x06) | byte4\r\n\t\t\tif (unit > 0xffff) {\r\n\t\t\t\tunit -= 0x10000\r\n\t\t\t\tunits.push(((unit >>> 10) & 0x3ff) | 0xd800)\r\n\t\t\t\tunit = 0xdc00 | (unit & 0x3ff)\r\n\t\t\t}\r\n\t\t\tunits.push(unit)\r\n\t\t} else {\r\n\t\t\tunits.push(byte1)\r\n\t\t}\r\n\r\n\t\tif (units.length >= 0x1000) {\r\n\t\t\tresult += fromCharCode.apply(String, units)\r\n\t\t\tunits.length = 0\r\n\t\t}\r\n\t}\r\n\r\n\tif (units.length > 0) {\r\n\t\tresult += fromCharCode.apply(String, units)\r\n\t}\r\n\r\n\treturn result\r\n}\r\nlet fromCharCode = String.fromCharCode\r\nfunction longStringInJS(length) {\r\n\tlet start = position\r\n\tlet bytes = new Array(length)\r\n\tfor (let i = 0; i < length; i++) {\r\n\t\tconst byte = src[position++];\r\n\t\tif ((byte & 0x80) > 0) {\r\n\t\t\tposition = start\r\n \t\t\treturn\r\n \t\t}\r\n \t\tbytes[i] = byte\r\n \t}\r\n \treturn fromCharCode.apply(String, bytes)\r\n}\r\nfunction shortStringInJS(length) {\r\n\tif (length < 4) {\r\n\t\tif (length < 2) {\r\n\t\t\tif (length === 0)\r\n\t\t\t\treturn ''\r\n\t\t\telse {\r\n\t\t\t\tlet a = src[position++]\r\n\t\t\t\tif ((a & 0x80) > 1) {\r\n\t\t\t\t\tposition -= 1\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\t\t\t\treturn fromCharCode(a)\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet a = src[position++]\r\n\t\t\tlet b = src[position++]\r\n\t\t\tif ((a & 0x80) > 0 || (b & 0x80) > 0) {\r\n\t\t\t\tposition -= 2\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tif (length < 3)\r\n\t\t\t\treturn fromCharCode(a, b)\r\n\t\t\tlet c = src[position++]\r\n\t\t\tif ((c & 0x80) > 0) {\r\n\t\t\t\tposition -= 3\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\treturn fromCharCode(a, b, c)\r\n\t\t}\r\n\t} else {\r\n\t\tlet a = src[position++]\r\n\t\tlet b = src[position++]\r\n\t\tlet c = src[position++]\r\n\t\tlet d = src[position++]\r\n\t\tif ((a & 0x80) > 0 || (b & 0x80) > 0 || (c & 0x80) > 0 || (d & 0x80) > 0) {\r\n\t\t\tposition -= 4\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif (length < 6) {\r\n\t\t\tif (length === 4)\r\n\t\t\t\treturn fromCharCode(a, b, c, d)\r\n\t\t\telse {\r\n\t\t\t\tlet e = src[position++]\r\n\t\t\t\tif ((e & 0x80) > 0) {\r\n\t\t\t\t\tposition -= 5\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\t\t\t\treturn fromCharCode(a, b, c, d, e)\r\n\t\t\t}\r\n\t\t} else if (length < 8) {\r\n\t\t\tlet e = src[position++]\r\n\t\t\tlet f = src[position++]\r\n\t\t\tif ((e & 0x80) > 0 || (f & 0x80) > 0) {\r\n\t\t\t\tposition -= 6\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tif (length < 7)\r\n\t\t\t\treturn fromCharCode(a, b, c, d, e, f)\r\n\t\t\tlet g = src[position++]\r\n\t\t\tif ((g & 0x80) > 0) {\r\n\t\t\t\tposition -= 7\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\treturn fromCharCode(a, b, c, d, e, f, g)\r\n\t\t} else {\r\n\t\t\tlet e = src[position++]\r\n\t\t\tlet f = src[position++]\r\n\t\t\tlet g = src[position++]\r\n\t\t\tlet h = src[position++]\r\n\t\t\tif ((e & 0x80) > 0 || (f & 0x80) > 0 || (g & 0x80) > 0 || (h & 0x80) > 0) {\r\n\t\t\t\tposition -= 8\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tif (length < 10) {\r\n\t\t\t\tif (length === 8)\r\n\t\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h)\r\n\t\t\t\telse {\r\n\t\t\t\t\tlet i = src[position++]\r\n\t\t\t\t\tif ((i & 0x80) > 0) {\r\n\t\t\t\t\t\tposition -= 9\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h, i)\r\n\t\t\t\t}\r\n\t\t\t} else if (length < 12) {\r\n\t\t\t\tlet i = src[position++]\r\n\t\t\t\tlet j = src[position++]\r\n\t\t\t\tif ((i & 0x80) > 0 || (j & 0x80) > 0) {\r\n\t\t\t\t\tposition -= 10\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\t\t\t\tif (length < 11)\r\n\t\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h, i, j)\r\n\t\t\t\tlet k = src[position++]\r\n\t\t\t\tif ((k & 0x80) > 0) {\r\n\t\t\t\t\tposition -= 11\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h, i, j, k)\r\n\t\t\t} else {\r\n\t\t\t\tlet i = src[position++]\r\n\t\t\t\tlet j = src[position++]\r\n\t\t\t\tlet k = src[position++]\r\n\t\t\t\tlet l = src[position++]\r\n\t\t\t\tif ((i & 0x80) > 0 || (j & 0x80) > 0 || (k & 0x80) > 0 || (l & 0x80) > 0) {\r\n\t\t\t\t\tposition -= 12\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\t\t\t\tif (length < 14) {\r\n\t\t\t\t\tif (length === 12)\r\n\t\t\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l)\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tlet m = src[position++]\r\n\t\t\t\t\t\tif ((m & 0x80) > 0) {\r\n\t\t\t\t\t\t\tposition -= 13\r\n\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m)\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlet m = src[position++]\r\n\t\t\t\t\tlet n = src[position++]\r\n\t\t\t\t\tif ((m & 0x80) > 0 || (n & 0x80) > 0) {\r\n\t\t\t\t\t\tposition -= 14\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (length < 15)\r\n\t\t\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n)\r\n\t\t\t\t\tlet o = src[position++]\r\n\t\t\t\t\tif ((o & 0x80) > 0) {\r\n\t\t\t\t\t\tposition -= 15\r\n\t\t\t\t\t\treturn\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction readBin(length) {\r\n\treturn currentDecoder.copyBuffers ?\r\n\t\t// specifically use the copying slice (not the node one)\r\n\t\tUint8Array.prototype.slice.call(src, position, position += length) :\r\n\t\tsrc.subarray(position, position += length)\r\n}\r\nfunction readExt(length) {\r\n\tlet type = src[position++]\r\n\tif (currentExtensions[type]) {\r\n\t\treturn currentExtensions[type](src.subarray(position, position += length))\r\n\t}\r\n\telse\r\n\t\tthrow new Error('Unknown extension type ' + type)\r\n}\r\n\r\nfunction getFloat16() {\r\n\tlet byte0 = src[position++]\r\n\tlet byte1 = src[position++]\r\n\tlet half = (byte0 << 8) + byte1\r\n\tlet exp = (half >> 10) & 0x1f\r\n\tlet mant = half & 0x3ff\r\n\tlet val\r\n\tif (exp == 0) val = Math.exp(mant, -24)\r\n\telse if (exp != 31) val = Math.exp(mant + 1024, exp - 25)\r\n\telse val = mant == 0 ? Infinity : NaN\r\n\treturn half & 0x8000 ? -val : val\r\n}\r\n\r\nlet keyCache = new Array(4096)\r\nfunction readKey() {\r\n\tlet length = src[position++]\r\n\tif (length >= 0x60 && length < 0x78) {\r\n\t\t// fixstr, potentially use key cache\r\n\t\tlength = length - 0x60\r\n\t\tif (srcStringEnd >= position) // if it has been extracted, must use it (and faster anyway)\r\n\t\t\treturn srcString.slice(position - srcStringStart, (position += length) - srcStringStart)\r\n\t\telse if (!(srcStringEnd == 0 && srcEnd < 180))\r\n\t\t\treturn readFixedString(length)\r\n\t} else { // not cacheable, go back and do a standard read\r\n\t\tposition--\r\n\t\treturn read()\r\n\t}\r\n\tlet key = ((length << 5) ^ (length > 1 ? dataView.getUint16(position) : length > 0 ? src[position] : 0)) & 0xfff\r\n\tlet entry = keyCache[key]\r\n\tlet checkPosition = position\r\n\tlet end = position + length - 3\r\n\tlet chunk\r\n\tlet i = 0\r\n\tif (entry && entry.bytes == length) {\r\n\t\twhile (checkPosition < end) {\r\n\t\t\tchunk = dataView.getUint32(checkPosition)\r\n\t\t\tif (chunk != entry[i++]) {\r\n\t\t\t\tcheckPosition = 0x70000000\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t\tcheckPosition += 4\r\n\t\t}\r\n\t\tend += 3\r\n\t\twhile (checkPosition < end) {\r\n\t\t\tchunk = src[checkPosition++]\r\n\t\t\tif (chunk != entry[i++]) {\r\n\t\t\t\tcheckPosition = 0x70000000\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (checkPosition === end) {\r\n\t\t\tposition = checkPosition\r\n\t\t\treturn entry.string\r\n\t\t}\r\n\t\tend -= 3\r\n\t\tcheckPosition = position\r\n\t}\r\n\tentry = []\r\n\tkeyCache[key] = entry\r\n\tentry.bytes = length\r\n\twhile (checkPosition < end) {\r\n\t\tchunk = dataView.getUint32(checkPosition)\r\n\t\tentry.push(chunk)\r\n\t\tcheckPosition += 4\r\n\t}\r\n\tend += 3\r\n\twhile (checkPosition < end) {\r\n\t\tchunk = src[checkPosition++]\r\n\t\tentry.push(chunk)\r\n\t}\r\n\t// for small blocks, avoiding the overhead of the extract call is helpful\r\n\tlet string = length < 16 ? shortStringInJS(length) : longStringInJS(length)\r\n\tif (string != null)\r\n\t\treturn entry.string = string\r\n\treturn entry.string = readFixedString(length)\r\n}\r\n\r\nexport class Tag {\r\n\tconstructor(value) {\r\n\t\tthis.value = value\r\n\t}\r\n}\r\n\r\nlet glbl = typeof window == 'object' ? window : global\r\n\r\ncurrentExtensions[0] = (dateString) => {\r\n\t// string date extension\r\n\treturn new Date(dateString)\r\n}\r\n\r\ncurrentExtensions[1] = (epochSec) => {\r\n\t// numeric date extension\r\n\treturn new Date(epochSec * 1000)\r\n}\r\n\r\ncurrentExtensions[2] = (buffer) => {\r\n\t// bigint extension\r\n\treturn new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength).getBigUint64(0)\r\n}\r\n\r\ncurrentExtensions[3] = (buffer) => {\r\n\t// negative bigint extension\r\n\treturn BigInt(-1) - (new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength).getBigUint64(0))\r\n}\r\n\r\n// the registration of the record definition extension (tag 105)\r\nconst recordDefinition = () => {\r\n\tlet definition = read()\r\n\tlet structure = definition[0]\r\n\tlet id = definition[1]\r\n\tcurrentStructures[id & 0xff] = structure\r\n\tstructure.read = createStructureReader(structure)\r\n\tlet object = {}\r\n\tfor (let i = 2,l = definition.length; i < l; i++) {\r\n\t\tlet key = structure[i - 2]\r\n\t\tobject[key] = definition[i]\r\n\t}\r\n\treturn object\r\n}\r\n\r\nrecordDefinition.handlesRead = true\r\ncurrentExtensions[RECORD_TAG_ID] = recordDefinition\r\n\r\ncurrentExtensions[27] = (data) => { // http://cbor.schmorp.de/generic-object\r\n\treturn (glbl[data[0]] || Error)(data[1], data[2])\r\n}\r\n\r\ncurrentExtensions[40009] = (id) => {\r\n\t// id extension (for structured clones)\r\n\tif (!referenceMap)\r\n\t\treferenceMap = new Map()\r\n\tlet token = src[position]\r\n\tlet target\r\n\t// TODO: handle Maps, Sets, and other types that can cycle; this is complicated, because you potentially need to read\r\n\t// ahead past references to record structure definitions\r\n\tif ((token >> 5) == 4)\r\n\t\ttarget = []\r\n\telse\r\n\t\ttarget = {}\r\n\r\n\tlet refEntry = { target } // a placeholder object\r\n\treferenceMap.set(id, refEntry)\r\n\tlet targetProperties = read() // read the next value as the target object to id\r\n\tif (refEntry.used) // there is a cycle, so we have to assign properties to original target\r\n\t\treturn Object.assign(target, targetProperties)\r\n\trefEntry.target = targetProperties // the placeholder wasn't used, replace with the deserialized one\r\n\treturn targetProperties // no cycle, can just use the returned read object\r\n}\r\n\r\ncurrentExtensions[40010] = (id) => {\r\n\t// pointer extension (for structured clones)\r\n\tlet refEntry = referenceMap.get(id)\r\n\trefEntry.used = true\r\n\treturn refEntry.target\r\n}\r\n\r\ncurrentExtensions[258] = (array) => new Set(array); // https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md\r\n(currentExtensions[259] = (read) => {\r\n\t// https://github.com/shanewholloway/js-cbor-codec/blob/master/docs/CBOR-259-spec\r\n\t// for decoding as a standard Map\r\n\tif (currentDecoder.mapsAsObjects) {\r\n\t\tcurrentDecoder.mapsAsObjects = false\r\n\t\trestoreMapsAsObject = true\r\n\t}\r\n\treturn read()\r\n}).handlesRead = true\r\n\r\n\r\nexport const typedArrays = ['Uint8', 'Uint8Clamped', 'Uint16', 'Uint32', 'BigUint64','Int8', 'Int16', 'Int32', 'BigInt64', 'Float32', 'Float64'].map(type => type + 'Array')\r\nconst typedArrayTags = [64, 68, 69, 70, 71, 72, 77, 78, 79, 81, 82]\r\nfor (let i = 0; i < typedArrays.length; i++) {\r\n\tregisterTypedArray(typedArrays[i], typedArrayTags[i])\r\n}\r\nfunction registerTypedArray(typedArrayName, tag) {\r\n\tcurrentExtensions[tag] = (buffer) => {\r\n\t\tif (!typedArrayName)\r\n\t\t\tthrow new Error('Could not find typed array for code ' + typeCode)\r\n\t\t// we have to always slice/copy here to get a new ArrayBuffer that is word/byte aligned\r\n\t\treturn new glbl[typedArrayName](Uint8Array.prototype.slice.call(buffer, 0).buffer)\r\n\t}\r\n}\r\n\r\nfunction saveState(callback) {\r\n\tlet savedSrcEnd = srcEnd\r\n\tlet savedPosition = position\r\n\tlet savedStringPosition = stringPosition\r\n\tlet savedSrcStringStart = srcStringStart\r\n\tlet savedSrcStringEnd = srcStringEnd\r\n\tlet savedSrcString = srcString\r\n\tlet savedStrings = strings\r\n\tlet savedReferenceMap = referenceMap\r\n\t// TODO: We may need to revisit this if we do more external calls to user code (since it could be slow)\r\n\tlet savedSrc = new Uint8Array(src.slice(0, srcEnd)) // we copy the data in case it changes while external data is processed\r\n\tlet savedStructures = currentStructures\r\n\tlet savedDecoder = currentDecoder\r\n\tlet savedSequentialMode = sequentialMode\r\n\tlet value = callback()\r\n\tsrcEnd = savedSrcEnd\r\n\tposition = savedPosition\r\n\tstringPosition = savedStringPosition\r\n\tsrcStringStart = savedSrcStringStart\r\n\tsrcStringEnd = savedSrcStringEnd\r\n\tsrcString = savedSrcString\r\n\tstrings = savedStrings\r\n\treferenceMap = savedReferenceMap\r\n\tsrc = savedSrc\r\n\tsequentialMode = savedSequentialMode\r\n\tcurrentStructures = savedStructures\r\n\tcurrentDecoder = savedDecoder\r\n\tdataView = new DataView(src.buffer, src.byteOffset, src.byteLength)\r\n\treturn value\r\n}\r\nexport function clearSource() {\r\n\tsrc = null\r\n\treferenceMap = null\r\n\tcurrentStructures = null\r\n}\r\n\r\nexport function addExtension(extension) {\r\n\tcurrentExtensions[extension.tag] = extension.decode\r\n}\r\n\r\nexport let mult10 = new Array(147) // this is a table matching binary exponents to the multiplier to determine significant digit rounding\r\nfor (let i = 0; i < 256; i++) {\r\n\tmult10[i] = +('1e' + Math.floor(45.15 - i * 0.30103))\r\n}\r\nexport const useRecords = false\r\nexport const mapsAsObjects = true\r\nlet defaultDecoder = new Decoder({ useRecords: false })\r\nexport const decode = defaultDecoder.decode\r\nexport const decodeMultiple = defaultDecoder.decodeMultiple\r\nexport const FLOAT32_OPTIONS = {\r\n\tNEVER: 0,\r\n\tALWAYS: 1,\r\n\tDECIMAL_ROUND: 3,\r\n\tDECIMAL_FIT: 4\r\n}\r\n","import { Decoder, mult10, Tag, typedArrays, addExtension as decodeAddExtension } from './decode.js'\r\nlet textEncoder\r\ntry {\r\n\ttextEncoder = new TextEncoder()\r\n} catch (error) {}\r\nlet extensions, extensionClasses\r\nconst hasNodeBuffer = typeof Buffer !== 'undefined'\r\nconst ByteArrayAllocate = hasNodeBuffer ? Buffer.allocUnsafeSlow : Uint8Array\r\nconst ByteArray = hasNodeBuffer ? Buffer : Uint8Array\r\nconst RECORD_STARTING_ID_PREFIX = 0x69 // tag 105/0x69\r\nconst MAX_STRUCTURES = 0x100\r\nconst MAX_BUFFER_SIZE = hasNodeBuffer ? 0x100000000 : 0x7fd00000\r\nlet target\r\nlet targetView\r\nlet position = 0\r\nlet safeEnd\r\nconst RECORD_SYMBOL = Symbol('record-id')\r\nexport class Encoder extends Decoder {\r\n\tconstructor(options) {\r\n\t\tsuper(options)\r\n\t\tthis.offset = 0\r\n\t\tlet typeBuffer\r\n\t\tlet start\r\n\t\tlet sharedStructures\r\n\t\tlet hasSharedUpdate\r\n\t\tlet structures\r\n\t\tlet referenceMap\r\n\t\tlet lastSharedStructuresLength = 0\r\n\t\tlet encodeUtf8 = ByteArray.prototype.utf8Write ? function(string, position, maxBytes) {\r\n\t\t\treturn target.utf8Write(string, position, maxBytes)\r\n\t\t} : (textEncoder && textEncoder.encodeInto) ?\r\n\t\t\tfunction(string, position) {\r\n\t\t\t\treturn textEncoder.encodeInto(string, target.subarray(position)).written\r\n\t\t\t} : false\r\n\r\n\t\tlet encoder = this\r\n\t\tlet maxSharedStructures = 64\r\n\t\tlet isSequential = options && options.sequential\r\n\t\tif (isSequential) {\r\n\t\t\tmaxSharedStructures = 0\r\n\t\t\tthis.structures = []\r\n\t\t}\r\n\t\tlet recordIdsToRemove = []\r\n\t\tlet transitionsCount = 0\r\n\t\tlet serializationsSinceTransitionRebuild = 0\r\n\t\tif (this.structures && this.structures.length > maxSharedStructures) {\r\n\t\t\tthrow new Error('Too many shared structures')\r\n\t\t}\r\n\r\n\t\tthis.encode = function(value) {\r\n\t\t\tif (!target) {\r\n\t\t\t\ttarget = new ByteArrayAllocate(8192)\r\n\t\t\t\ttargetView = new DataView(target.buffer, 0, 8192)\r\n\t\t\t\tposition = 0\r\n\t\t\t}\r\n\t\t\tsafeEnd = target.length - 10\r\n\t\t\tif (safeEnd - position < 0x800) {\r\n\t\t\t\t// don't start too close to the end, \r\n\t\t\t\ttarget = new ByteArrayAllocate(target.length)\r\n\t\t\t\ttargetView = new DataView(target.buffer, 0, target.length)\r\n\t\t\t\tsafeEnd = target.length - 10\r\n\t\t\t\tposition = 0\r\n\t\t\t}\r\n\t\t\tstart = position\r\n\t\t\treferenceMap = encoder.structuredClone ? new Map() : null\r\n\t\t\tsharedStructures = encoder.structures\r\n\t\t\tif (sharedStructures) {\r\n\t\t\t\tif (sharedStructures.uninitialized)\r\n\t\t\t\t\tencoder.structures = sharedStructures = encoder.getStructures()\r\n\t\t\t\tlet sharedStructuresLength = sharedStructures.length\r\n\t\t\t\tif (sharedStructuresLength > maxSharedStructures && !isSequential)\r\n\t\t\t\t\tsharedStructuresLength = maxSharedStructures\r\n\t\t\t\tif (!sharedStructures.transitions) {\r\n\t\t\t\t\t// rebuild our structure transitions\r\n\t\t\t\t\tsharedStructures.transitions = Object.create(null)\r\n\t\t\t\t\tfor (let i = 0; i < sharedStructuresLength; i++) {\r\n\t\t\t\t\t\tlet keys = sharedStructures[i]\r\n\t\t\t\t\t\tif (!keys)\r\n\t\t\t\t\t\t\tcontinue\r\n\t\t\t\t\t\tlet nextTransition, transition = sharedStructures.transitions\r\n\t\t\t\t\t\tfor (let i =0, l = keys.length; i < l; i++) {\r\n\t\t\t\t\t\t\tlet key = keys[i]\r\n\t\t\t\t\t\t\tnextTransition = transition[key]\r\n\t\t\t\t\t\t\tif (!nextTransition) {\r\n\t\t\t\t\t\t\t\tnextTransition = transition[key] = Object.create(null)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttransition = nextTransition\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttransition[RECORD_SYMBOL] = i\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlastSharedStructuresLength = sharedStructures.length\r\n\t\t\t\t}\r\n\t\t\t\tif (!isSequential)\r\n\t\t\t\t\tsharedStructures.nextId = sharedStructuresLength\r\n\t\t\t}\r\n\t\t\tif (hasSharedUpdate)\r\n\t\t\t\thasSharedUpdate = false\r\n\t\t\tstructures = sharedStructures || []\r\n\t\t\ttry {\r\n\t\t\t\tencode(value)\r\n\t\t\t\tencoder.offset = position // update the offset so next serialization doesn't write over our buffer, but can continue writing to same buffer sequentially\r\n\t\t\t\tif (referenceMap && referenceMap.idsToInsert) {\r\n\t\t\t\t\tposition += referenceMap.idsToInsert.length * 8\r\n\t\t\t\t\tif (position > safeEnd)\r\n\t\t\t\t\t\tmakeRoom(position)\r\n\t\t\t\t\tencoder.offset = position\r\n\t\t\t\t\tlet serialized = insertIds(target.subarray(start, position), referenceMap.idsToInsert)\r\n\t\t\t\t\treferenceMap = null\r\n\t\t\t\t\treturn serialized\r\n\t\t\t\t}\r\n\t\t\t\treturn target.subarray(start, position) // position can change if we call encode again in saveStructures, so we get the buffer now\r\n\t\t\t} finally {\r\n\t\t\t\tif (sharedStructures) {\r\n\t\t\t\t\tif (serializationsSinceTransitionRebuild < 10)\r\n\t\t\t\t\t\tserializationsSinceTransitionRebuild++\r\n\t\t\t\t\tif (transitionsCount > 10000) {\r\n\t\t\t\t\t\t// force a rebuild occasionally after a lot of transitions so it can get cleaned up\r\n\t\t\t\t\t\tsharedStructures.transitions = null\r\n\t\t\t\t\t\tserializationsSinceTransitionRebuild = 0\r\n\t\t\t\t\t\ttransitionsCount = 0\r\n\t\t\t\t\t\tif (recordIdsToRemove.length > 0)\r\n\t\t\t\t\t\t\trecordIdsToRemove = []\r\n\t\t\t\t\t} else if (recordIdsToRemove.length > 0 && !isSequential) {\r\n\t\t\t\t\t\tfor (let i = 0, l = recordIdsToRemove.length; i < l; i++) {\r\n\t\t\t\t\t\t\trecordIdsToRemove[i][RECORD_SYMBOL] = undefined\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trecordIdsToRemove = []\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (hasSharedUpdate && encoder.saveStructures) {\r\n\t\t\t\t\t\tif (encoder.structures.length > maxSharedStructures) {\r\n\t\t\t\t\t\t\tencoder.structures = encoder.structures.slice(0, maxSharedStructures)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (encoder.saveStructures(encoder.structures, lastSharedStructuresLength) === false) {\r\n\t\t\t\t\t\t\t// get updated structures and try again if the update failed\r\n\t\t\t\t\t\t\tencoder.structures = encoder.getStructures() || []\r\n\t\t\t\t\t\t\treturn encoder.encode(value)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlastSharedStructuresLength = encoder.structures.length\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tconst encode = (value) => {\r\n\t\t\tif (position > safeEnd)\r\n\t\t\t\ttarget = makeRoom(position)\r\n\r\n\t\t\tvar type = typeof value\r\n\t\t\tvar length\r\n\t\t\tif (type === 'string') {\r\n\t\t\t\tlet strLength = value.length\r\n\t\t\t\tlet headerSize\r\n\t\t\t\t// first we estimate the header size, so we can write to the correct location\r\n\t\t\t\tif (strLength < 0x20) {\r\n\t\t\t\t\theaderSize = 1\r\n\t\t\t\t} else if (strLength < 0x100) {\r\n\t\t\t\t\theaderSize = 2\r\n\t\t\t\t} else if (strLength < 0x10000) {\r\n\t\t\t\t\theaderSize = 3\r\n\t\t\t\t} else {\r\n\t\t\t\t\theaderSize = 5\r\n\t\t\t\t}\r\n\t\t\t\tlet maxBytes = strLength * 3\r\n\t\t\t\tif (position + maxBytes > safeEnd)\r\n\t\t\t\t\ttarget = makeRoom(position + maxBytes)\r\n\r\n\t\t\t\tif (strLength < 0x40 || !encodeUtf8) {\r\n\t\t\t\t\tlet i, c1, c2, strPosition = position + headerSize\r\n\t\t\t\t\tfor (i = 0; i < strLength; i++) {\r\n\t\t\t\t\t\tc1 = value.charCodeAt(i)\r\n\t\t\t\t\t\tif (c1 < 0x80) {\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1\r\n\t\t\t\t\t\t} else if (c1 < 0x800) {\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 >> 6 | 0xc0\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 & 0x3f | 0x80\r\n\t\t\t\t\t\t} else if (\r\n\t\t\t\t\t\t\t(c1 & 0xfc00) === 0xd800 &&\r\n\t\t\t\t\t\t\t((c2 = value.charCodeAt(i + 1)) & 0xfc00) === 0xdc00\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\tc1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff)\r\n\t\t\t\t\t\t\ti++\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 >> 18 | 0xf0\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 >> 12 & 0x3f | 0x80\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 >> 6 & 0x3f | 0x80\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 & 0x3f | 0x80\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 >> 12 | 0xe0\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 >> 6 & 0x3f | 0x80\r\n\t\t\t\t\t\t\ttarget[strPosition++] = c1 & 0x3f | 0x80\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlength = strPosition - position - headerSize\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlength = encodeUtf8(value, position + headerSize, maxBytes)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (length < 0x18) {\r\n\t\t\t\t\ttarget[position++] = 0x60 | length\r\n\t\t\t\t} else if (length < 0x100) {\r\n\t\t\t\t\tif (headerSize < 2) {\r\n\t\t\t\t\t\ttarget.copyWithin(position + 2, position + 1, position + 1 + length)\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttarget[position++] = 0x78\r\n\t\t\t\t\ttarget[position++] = length\r\n\t\t\t\t} else if (length < 0x10000) {\r\n\t\t\t\t\tif (headerSize < 3) {\r\n\t\t\t\t\t\ttarget.copyWithin(position + 3, position + 2, position + 2 + length)\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttarget[position++] = 0x79\r\n\t\t\t\t\ttarget[position++] = length >> 8\r\n\t\t\t\t\ttarget[position++] = length & 0xff\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (headerSize < 5) {\r\n\t\t\t\t\t\ttarget.copyWithin(position + 5, position + 3, position + 3 + length)\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttarget[position++] = 0x7a\r\n\t\t\t\t\ttargetView.setUint32(position, length)\r\n\t\t\t\t\tposition += 4\r\n\t\t\t\t}\r\n\t\t\t\tposition += length\r\n\t\t\t} else if (type === 'number') {\r\n\t\t\t\tif (value >>> 0 === value) {// positive integer, 32-bit or less\r\n\t\t\t\t\t// positive uint\r\n\t\t\t\t\tif (value < 0x18) {\r\n\t\t\t\t\t\ttarget[position++] = value\r\n\t\t\t\t\t} else if (value < 0x100) {\r\n\t\t\t\t\t\ttarget[position++] = 0x18\r\n\t\t\t\t\t\ttarget[position++] = value\r\n\t\t\t\t\t} else if (value < 0x10000) {\r\n\t\t\t\t\t\ttarget[position++] = 0x19\r\n\t\t\t\t\t\ttarget[position++] = value >> 8\r\n\t\t\t\t\t\ttarget[position++] = value & 0xff\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttarget[position++] = 0x1a\r\n\t\t\t\t\t\ttargetView.setUint32(position, value)\r\n\t\t\t\t\t\tposition += 4\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (value >> 0 === value) { // negative integer\r\n\t\t\t\t\tif (value >= -0x18) {\r\n\t\t\t\t\t\ttarget[position++] = 0x1f - value\r\n\t\t\t\t\t} else if (value >= -0x100) {\r\n\t\t\t\t\t\ttarget[position++] = 0x38\r\n\t\t\t\t\t\ttarget[position++] = ~value\r\n\t\t\t\t\t} else if (value >= -0x10000) {\r\n\t\t\t\t\t\ttarget[position++] = 0x39\r\n\t\t\t\t\t\ttargetView.setUint16(position, ~value)\r\n\t\t\t\t\t\tposition += 2\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttarget[position++] = 0x3a\r\n\t\t\t\t\t\ttargetView.setUint32(position, ~value)\r\n\t\t\t\t\t\tposition += 4\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlet useFloat32\r\n\t\t\t\t\tif ((useFloat32 = this.useFloat32) > 0 && value < 0x100000000 && value >= -0x80000000) {\r\n\t\t\t\t\t\ttarget[position++] = 0xfa\r\n\t\t\t\t\t\ttargetView.setFloat32(position, value)\r\n\t\t\t\t\t\tlet xShifted\r\n\t\t\t\t\t\tif (useFloat32 < 4 ||\r\n\t\t\t\t\t\t\t// this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved\r\n\t\t\t\t\t\t\t\t((xShifted = value * mult10[((target[position] & 0x7f) << 1) | (target[position + 1] >> 7)]) >> 0) === xShifted) {\r\n\t\t\t\t\t\t\tposition += 4\r\n\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\tposition-- // move back into position for writing a double\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttarget[position++] = 0xfb\r\n\t\t\t\t\ttargetView.setFloat64(position, value)\r\n\t\t\t\t\tposition += 8\r\n\t\t\t\t}\r\n\t\t\t} else if (type === 'object') {\r\n\t\t\t\tif (!value)\r\n\t\t\t\t\ttarget[position++] = 0xf6\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (referenceMap) {\r\n\t\t\t\t\t\tlet referee = referenceMap.get(value)\r\n\t\t\t\t\t\tif (referee) {\r\n\t\t\t\t\t\t\tif (!referee.id) {\r\n\t\t\t\t\t\t\t\tlet idsToInsert = referenceMap.idsToInsert || (referenceMap.idsToInsert = [])\r\n\t\t\t\t\t\t\t\treferee.id = idsToInsert.push(referee)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttarget[position++] = 0xd9\r\n\t\t\t\t\t\t\ttarget[position++] = 40010 >> 8\r\n\t\t\t\t\t\t\ttarget[position++] = 40010 & 0xff\r\n\t\t\t\t\t\t\ttarget[position++] = 0x1a // uint32\r\n\t\t\t\t\t\t\ttargetView.setUint32(position, referee.id)\r\n\t\t\t\t\t\t\tposition += 4\r\n\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t} else \r\n\t\t\t\t\t\t\treferenceMap.set(value, { offset: position - start })\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet constructor = value.constructor\r\n\t\t\t\t\tif (constructor === Object) {\r\n\t\t\t\t\t\twriteObject(value, true)\r\n\t\t\t\t\t} else if (constructor === Array) {\r\n\t\t\t\t\t\tlength = value.length\r\n\t\t\t\t\t\tif (length < 0x18) {\r\n\t\t\t\t\t\t\ttarget[position++] = 0x80 | length\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\twriteArrayHeader(length)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (let i = 0; i < length; i++) {\r\n\t\t\t\t\t\t\tencode(value[i])\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (constructor === Map) {\r\n\t\t\t\t\t\tif (this.mapsAsObjects ? this.useTag259ForMaps !== false : this.useTag259ForMaps) {\r\n\t\t\t\t\t\t\t// use Tag 259 (https://github.com/shanewholloway/js-cbor-codec/blob/master/docs/CBOR-259-spec--explicit-maps.md) for maps if the user wants it that way\r\n\t\t\t\t\t\t\ttarget[position++] = 0xd9\r\n\t\t\t\t\t\t\ttarget[position++] = 1\r\n\t\t\t\t\t\t\ttarget[position++] = 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlength = value.size\r\n\t\t\t\t\t\tif (length < 0x18) {\r\n\t\t\t\t\t\t\ttarget[position++] = 0xa0 | length\r\n\t\t\t\t\t\t} else if (length < 0x100) {\r\n\t\t\t\t\t\t\ttarget[position++] = 0xb8\r\n\t\t\t\t\t\t\ttarget[position++] = length\r\n\t\t\t\t\t\t} else if (length < 0x10000) {\r\n\t\t\t\t\t\t\ttarget[position++] = 0xb9\r\n\t\t\t\t\t\t\ttarget[position++] = length >> 8\r\n\t\t\t\t\t\t\ttarget[position++] = length & 0xff\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttarget[position++] = 0xba\r\n\t\t\t\t\t\t\ttargetView.setUint32(position, length)\r\n\t\t\t\t\t\t\tposition += 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (let [ key, entryValue ] of value) {\r\n\t\t\t\t\t\t\tencode(key)\r\n\t\t\t\t\t\t\tencode(entryValue)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\t\r\n\t\t\t\t\t\tfor (let i = 0, l = extensions.length; i < l; i++) {\r\n\t\t\t\t\t\t\tlet extensionClass = extensionClasses[i]\r\n\t\t\t\t\t\t\tif (value instanceof extensionClass) {\r\n\t\t\t\t\t\t\t\tlet extension = extensions[i]\r\n\t\t\t\t\t\t\t\tlet tag = extension.tag\r\n\t\t\t\t\t\t\t\tif (tag < 0x18) {\r\n\t\t\t\t\t\t\t\t\ttarget[position++] = 0xc0 | tag\r\n\t\t\t\t\t\t\t\t} else if (tag < 0x100) {\r\n\t\t\t\t\t\t\t\t\ttarget[position++] = 0xd8\r\n\t\t\t\t\t\t\t\t\ttarget[position++] = tag\r\n\t\t\t\t\t\t\t\t} else if (tag < 0x10000) {\r\n\t\t\t\t\t\t\t\t\ttarget[position++] = 0xd9\r\n\t\t\t\t\t\t\t\t\ttarget[position++] = tag >> 8\r\n\t\t\t\t\t\t\t\t\ttarget[position++] = tag & 0xff\r\n\t\t\t\t\t\t\t\t} else if (tag > -1) {\r\n\t\t\t\t\t\t\t\t\ttarget[position++] = 0xda\r\n\t\t\t\t\t\t\t\t\ttargetView.setUint32(position, tag)\r\n\t\t\t\t\t\t\t\t\tposition += 4\r\n\t\t\t\t\t\t\t\t} // else undefined, don't write tag\r\n\t\t\t\t\t\t\t\textension.encode.call(this, value, encode, makeRoom)\r\n\t\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (value[Symbol.iterator]) {\r\n\t\t\t\t\t\t\ttarget[position++] = 0x9f // indefinite length array\r\n\t\t\t\t\t\t\tfor (let entry of value) {\r\n\t\t\t\t\t\t\t\tencode(entry)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttarget[position++] = 0xff // stop-code\r\n\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// no extension found, write as object\r\n\t\t\t\t\t\twriteObject(value, !value.hasOwnProperty) // if it doesn't have hasOwnProperty, don't do hasOwnProperty checks\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (type === 'boolean') {\r\n\t\t\t\ttarget[position++] = value ? 0xf5 : 0xf4\r\n\t\t\t} else if (type === 'bigint') {\r\n\t\t\t\tif (value < (BigInt(1)<= 0) {\r\n\t\t\t\t\t// use an unsigned int as long as it fits\r\n\t\t\t\t\ttarget[position++] = 0x1b\r\n\t\t\t\t\ttargetView.setBigUint64(position, value)\r\n\t\t\t\t} else if (value > -(BigInt(1)< {\r\n\t\t\t// this method is slightly slower, but generates \"preferred serialization\" (optimally small for smaller objects)\r\n\t\t\tlet keys = Object.keys(object)\r\n\t\t\tlet length = keys.length\r\n\t\t\tif (length < 0x18) {\r\n\t\t\t\ttarget[position++] = 0xa0 | length\r\n\t\t\t} else if (length < 0x100) {\r\n\t\t\t\ttarget[position++] = 0xb8\r\n\t\t\t\ttarget[position++] = length\r\n\t\t\t} else if (length < 0x10000) {\r\n\t\t\t\ttarget[position++] = 0xb9\r\n\t\t\t\ttarget[position++] = length >> 8\r\n\t\t\t\ttarget[position++] = length & 0xff\r\n\t\t\t} else {\r\n\t\t\t\ttarget[position++] = 0xba\r\n\t\t\t\ttargetView.setUint32(position, length)\r\n\t\t\t\tposition += 4\r\n\t\t\t}\r\n\t\t\tlet key\r\n\t\t\tfor (let i = 0; i < length; i++) {\r\n\t\t\t\tencode(key = keys[i])\r\n\t\t\t\tencode(object[key])\r\n\t\t\t}\r\n\t\t} :\r\n\t\t(object, safePrototype) => {\r\n\t\t\ttarget[position++] = 0xb9 // always use map 16, so we can preallocate and set the length afterwards\r\n\t\t\tlet objectOffset = position - start\r\n\t\t\tposition += 2\r\n\t\t\tlet size = 0\r\n\t\t\tfor (let key in object) {\r\n\t\t\t\tif (safePrototype || object.hasOwnProperty(key)) {\r\n\t\t\t\t\tencode(key)\r\n\t\t\t\t\tencode(object[key])\r\n\t\t\t\t\tsize++\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttarget[objectOffset++ + start] = size >> 8\r\n\t\t\ttarget[objectOffset + start] = size & 0xff\r\n\t\t} :\r\n\r\n\t/*\tsharedStructures ? // For highly stable structures, using for-in can a little bit faster\r\n\t\t(object, safePrototype) => {\r\n\t\t\tlet nextTransition, transition = structures.transitions || (structures.transitions = Object.create(null))\r\n\t\t\tlet objectOffset = position++ - start\r\n\t\t\tlet wroteKeys\r\n\t\t\tfor (let key in object) {\r\n\t\t\t\tif (safePrototype || object.hasOwnProperty(key)) {\r\n\t\t\t\t\tnextTransition = transition[key]\r\n\t\t\t\t\tif (!nextTransition) {\r\n\t\t\t\t\t\tnextTransition = transition[key] = Object.create(null)\r\n\t\t\t\t\t\tnextTransition.__keys__ = (transition.__keys__ || []).concat([key])\r\n\t\t\t\t\t\t/*let keys = Object.keys(object)\r\n\t\t\t\t\t\tif \r\n\t\t\t\t\t\tlet size = 0\r\n\t\t\t\t\t\tlet startBranch = transition.__keys__ ? transition.__keys__.length : 0\r\n\t\t\t\t\t\tfor (let i = 0, l = keys.length; i++) {\r\n\t\t\t\t\t\t\tlet key = keys[i]\r\n\t\t\t\t\t\t\tsize += key.length << 2\r\n\t\t\t\t\t\t\tif (i >= startBranch) {\r\n\t\t\t\t\t\t\t\tnextTransition = nextTransition[key] = Object.create(null)\r\n\t\t\t\t\t\t\t\tnextTransition.__keys__ = keys.slice(0, i + 1)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tmakeRoom(position + size)\r\n\t\t\t\t\t\tnextTransition = transition[key]\r\n\t\t\t\t\t\ttarget.copy(target, )\r\n\t\t\t\t\t\tobjectOffset\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttransition = nextTransition\r\n\t\t\t\t\tencode(object[key])\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlet id = transition.id\r\n\t\t\tif (!id) {\r\n\t\t\t\tid = transition.id = structures.push(transition.__keys__) + 63\r\n\t\t\t\tif (sharedStructures.onUpdate)\r\n\t\t\t\t\tsharedStructures.onUpdate(id, transition.__keys__)\r\n\t\t\t}\r\n\t\t\ttarget[objectOffset + start] = id\r\n\t\t}*/\r\n\t\t(object) => {\r\n\t\t\tlet keys = Object.keys(object)\r\n\t\t\tlet nextTransition, transition = structures.transitions || (structures.transitions = Object.create(null))\r\n\t\t\tlet newTransitions = 0\r\n\t\t\tlet length = keys.length\r\n\t\t\tfor (let i =0; i < length; i++) {\r\n\t\t\t\tlet key = keys[i]\r\n\t\t\t\tnextTransition = transition[key]\r\n\t\t\t\tif (!nextTransition) {\r\n\t\t\t\t\tnextTransition = transition[key] = Object.create(null)\r\n\t\t\t\t\tnewTransitions++\r\n\t\t\t\t}\r\n\t\t\t\ttransition = nextTransition\r\n\t\t\t}\r\n\t\t\tlet recordId = transition[RECORD_SYMBOL]\r\n\t\t\tif (recordId !== undefined) {\r\n\t\t\t\ttarget[position++] = 0xd9 // tag two byte\r\n\t\t\t\ttarget[position++] = RECORD_STARTING_ID_PREFIX\r\n\t\t\t\ttarget[position++] = recordId\r\n\t\t\t} else {\r\n\t\t\t\trecordId = structures.nextId++\r\n\t\t\t\tif (!recordId) {\r\n\t\t\t\t\trecordId = 0\r\n\t\t\t\t\tstructures.nextId = 1\r\n\t\t\t\t}\r\n\t\t\t\tif (recordId >= MAX_STRUCTURES) {// cycle back around\r\n\t\t\t\t\tstructures.nextId = (recordId = maxSharedStructures) + 1\r\n\t\t\t\t}\r\n\t\t\t\ttransition[RECORD_SYMBOL] = recordId\r\n\t\t\t\tstructures[recordId] = keys\r\n\t\t\t\tif (sharedStructures && sharedStructures.length <= maxSharedStructures) {\r\n\t\t\t\t\ttarget[position++] = 0xd9 // tag two byte\r\n\t\t\t\t\ttarget[position++] = RECORD_STARTING_ID_PREFIX\r\n\t\t\t\t\ttarget[position++] = recordId // tag number\r\n\t\t\t\t\thasSharedUpdate = true\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttarget[position++] = 0xd8\r\n\t\t\t\t\ttarget[position++] = RECORD_STARTING_ID_PREFIX\r\n\t\t\t\t\tif (newTransitions)\r\n\t\t\t\t\t\ttransitionsCount += serializationsSinceTransitionRebuild * newTransitions\r\n\t\t\t\t\t// record the removal of the id, we can maintain our shared structure\r\n\t\t\t\t\tif (recordIdsToRemove.length >= MAX_STRUCTURES - maxSharedStructures)\r\n\t\t\t\t\t\trecordIdsToRemove.shift()[RECORD_SYMBOL] = undefined // we are cycling back through, and have to remove old ones\r\n\t\t\t\t\trecordIdsToRemove.push(transition)\r\n\t\t\t\t\tif (length < 0x16)\r\n\t\t\t\t\t\ttarget[position++] = 0x82 + length // array header, length of values + 2\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\twriteArrayHeader(length + 2)\r\n\t\t\t\t\tencode(keys)\r\n\t\t\t\t\ttarget[position++] = 0x19 // uint16\r\n\t\t\t\t\ttarget[position++] = RECORD_STARTING_ID_PREFIX\r\n\t\t\t\t\ttarget[position++] = recordId\r\n\t\t\t\t\t// now write the values\r\n\t\t\t\t\tfor (let i =0; i < length; i++)\r\n\t\t\t\t\t\tencode(object[keys[i]])\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (length < 0x18) { // write the array header\r\n\t\t\t\ttarget[position++] = 0x80 | length\r\n\t\t\t} else {\r\n\t\t\t\twriteArrayHeader(length)\r\n\t\t\t}\r\n\t\t\tfor (let i =0; i < length; i++)\r\n\t\t\t\tencode(object[keys[i]])\r\n\t\t}\r\n\t\tconst makeRoom = (end) => {\r\n\t\t\tlet newSize\r\n\t\t\tif (end > 0x1000000) {\r\n\t\t\t\t// special handling for really large buffers\r\n\t\t\t\tif ((end - start) > MAX_BUFFER_SIZE)\r\n\t\t\t\t\tthrow new Error('Encoded buffer would be larger than maximum buffer size')\r\n\t\t\t\tnewSize = Math.min(MAX_BUFFER_SIZE,\r\n\t\t\t\t\tMath.round(Math.max((end - start) * (end > 0x4000000 ? 1.25 : 2), 0x1000000) / 0x1000) * 0x1000)\r\n\t\t\t} else // faster handling for smaller buffers\r\n\t\t\t\tnewSize = ((Math.max((end - start) << 2, target.length - 1) >> 12) + 1) << 12\r\n\t\t\tlet newBuffer = new ByteArrayAllocate(newSize)\r\n\t\t\ttargetView = new DataView(newBuffer.buffer, 0, newSize)\r\n\t\t\tif (target.copy)\r\n\t\t\t\ttarget.copy(newBuffer, 0, start, end)\r\n\t\t\telse\r\n\t\t\t\tnewBuffer.set(target.slice(start, end))\r\n\t\t\tposition -= start\r\n\t\t\tstart = 0\r\n\t\t\tsafeEnd = newBuffer.length - 10\r\n\t\t\treturn target = newBuffer\r\n\t\t}\r\n\t}\r\n\tuseBuffer(buffer) {\r\n\t\t// this means we are finished using our own buffer and we can write over it safely\r\n\t\ttarget = buffer\r\n\t\ttargetView = new DataView(target.buffer, target.byteOffset, target.byteLength)\r\n\t\tposition = 0\r\n\t}\r\n}\r\n\r\nfunction copyBinary(source, target, targetOffset, offset, endOffset) {\r\n\twhile (offset < endOffset) {\r\n\t\ttarget[targetOffset++] = source[offset++]\r\n\t}\r\n}\r\n\r\nfunction writeArrayHeader(length) {\r\n\tif (length < 0x100) {\r\n\t\ttarget[position++] = 0x98\r\n\t\ttarget[position++] = length\r\n\t} else if (length < 0x10000) {\r\n\t\ttarget[position++] = 0x99\r\n\t\ttarget[position++] = length >> 8\r\n\t\ttarget[position++] = length & 0xff\r\n\t} else {\r\n\t\ttarget[position++] = 0x9a\r\n\t\ttargetView.setUint32(position, length)\r\n\t\tposition += 4\r\n\t}\r\n}\r\n\r\nextensionClasses = [ Date, Set, Error, RegExp, ArrayBuffer, ByteArray,\r\n\tUint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, BigUint64Array, Int8Array, Int16Array, Int32Array, BigInt64Array,\r\n\tFloat32Array, Float64Array]\r\n\r\n//Object.getPrototypeOf(Uint8Array.prototype).constructor /*TypedArray*/\r\nextensions = [{\r\n\ttag: 1,\r\n\tencode(date, encode) {\r\n\t\tlet seconds = date.getTime() / 1000\r\n\t\tif ((this.useTimestamp32 || date.getMilliseconds() === 0) && seconds >= 0 && seconds < 0x100000000) {\r\n\t\t\t// Timestamp 32\r\n\t\t\ttarget[position++] = 0x1a\r\n\t\t\ttargetView.setUint32(position, seconds)\r\n\t\t\tposition += 4\r\n\t\t} else {\r\n\t\t\t// Timestamp float64\r\n\t\t\ttarget[position++] = 0xfb\r\n\t\t\ttargetView.setFloat64(position, seconds)\r\n\t\t\tposition += 8\r\n\t\t}\r\n\t}\r\n}, {\r\n\ttag: 258, // https://github.com/input-output-hk/cbor-sets-spec/blob/master/CBOR_SETS.md\r\n\tencode(set, encode) {\r\n\t\tlet array = Array.from(set)\r\n\t\tencode(array)\r\n\t}\r\n}, {\r\n\ttag: 27, // http://cbor.schmorp.de/generic-object\r\n\tencode(error, encode) {\r\n\t\tencode([ error.name, error.message ])\r\n\t}\r\n}, {\r\n\ttag: 27, // http://cbor.schmorp.de/generic-object\r\n\tencode(regex, encode) {\r\n\t\tencode([ 'RegExp', regex.source, regex.flags ])\r\n\t}\r\n}, {\r\n\tencode(arrayBuffer, encode, makeRoom) {\r\n\t\twriteBuffer(arrayBuffer, makeRoom)\r\n\t}\r\n}, {\r\n\tencode(arrayBuffer, encode, makeRoom) {\r\n\t\twriteBuffer(arrayBuffer, makeRoom)\r\n\t}\r\n}, typedArrayEncoder(64),\r\n\ttypedArrayEncoder(68),\r\n\ttypedArrayEncoder(69),\r\n\ttypedArrayEncoder(70),\r\n\ttypedArrayEncoder(71),\r\n\ttypedArrayEncoder(72),\r\n\ttypedArrayEncoder(77),\r\n\ttypedArrayEncoder(78),\r\n\ttypedArrayEncoder(79),\r\n\ttypedArrayEncoder(81),\r\n\ttypedArrayEncoder(82)]\r\n\r\nfunction typedArrayEncoder(tag) {\r\n\treturn {\r\n\t\ttag: tag,\r\n\t\tencode: function writeExtBuffer(typedArray, encode) {\r\n\t\t\tlet length = typedArray.byteLength\r\n\t\t\tlet offset = typedArray.byteOffset || 0\r\n\t\t\tlet buffer = typedArray.buffer || typedArray\r\n\t\t\tencode(hasNodeBuffer ? Buffer.from(buffer, offset, length) :\r\n\t\t\t\tnew Uint8Array(buffer, offset, length))\r\n\t\t}\r\n\t}\r\n}\r\nfunction writeBuffer(buffer, makeRoom) {\r\n\tlet length = buffer.byteLength\r\n\tif (length < 0x18) {\r\n\t\ttarget[position++] = 0x40 + length\r\n\t} else if (length < 0x100) {\r\n\t\ttarget[position++] = 0x58\r\n\t\ttarget[position++] = length\r\n\t} else if (length < 0x10000) {\r\n\t\ttarget[position++] = 0x59\r\n\t\ttarget[position++] = length >> 8\r\n\t\ttarget[position++] = length & 0xff\r\n\t} else {\r\n\t\ttarget[position++] = 0x5a\r\n\t\ttargetView.setUint32(position, length)\r\n\t\tposition += 4\r\n\t}\r\n\tif (position + length >= target.length) {\r\n\t\tmakeRoom(position + length)\r\n\t}\r\n\ttarget.set(buffer, position)\r\n\tposition += length\r\n}\r\n\r\nfunction insertIds(serialized, idsToInsert) {\r\n\t// insert the ids that need to be referenced for structured clones\r\n\tlet nextId\r\n\tlet distanceToMove = idsToInsert.length * 8\r\n\tlet lastEnd = serialized.length - distanceToMove\r\n\tidsToInsert.sort((a, b) => a.offset > b.offset ? 1 : -1)\r\n\twhile (nextId = idsToInsert.pop()) {\r\n\t\tlet offset = nextId.offset\r\n\t\tlet id = nextId.id\r\n\t\tserialized.copyWithin(offset + distanceToMove, offset, lastEnd)\r\n\t\tdistanceToMove -= 8\r\n\t\tlet position = offset + distanceToMove\r\n\t\tserialized[position++] = 0xd9\r\n\t\tserialized[position++] = 40009 >> 8\r\n\t\tserialized[position++] = 40009 & 0xff\r\n\t\tserialized[position++] = 0x1a // uint32\r\n\t\tserialized[position++] = id >> 24\r\n\t\tserialized[position++] = (id >> 16) & 0xff\r\n\t\tserialized[position++] = (id >> 8) & 0xff\r\n\t\tserialized[position++] = id & 0xff\r\n\t\tlastEnd = offset\r\n\t}\r\n\treturn serialized\r\n}\r\n\r\nexport function addExtension(extension) {\r\n\tif (extension.Class) {\r\n\t\tif (!extension.encode)\r\n\t\t\tthrow new Error('Extension has no encode function')\r\n\t\textensionClasses.unshift(extension.Class)\r\n\t\textensions.unshift(extension)\r\n\t}\r\n\tdecodeAddExtension(extension)\r\n}\r\nlet defaultEncoder = new Encoder({ useRecords: false })\r\nexport const encode = defaultEncoder.encode\r\nexport { FLOAT32_OPTIONS } from './decode.js'\r\nimport { FLOAT32_OPTIONS } from './decode.js'\r\nexport const { NEVER, ALWAYS, DECIMAL_ROUND, DECIMAL_FIT } = FLOAT32_OPTIONS\r\n","/**@license\n *\n * No Dependency fast and small LZJB Compression for Browser and Node\n *\n * Copyright (c) 2021 Jakub T. Jankiewicz https://jcubic.pl/me\n * Released under BSD-3-Clause License\n *\n * build: Wed, 27 Oct 2021 10:43:10 GMT\n */\n\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*\n * source https://github.com/copy/jslzjb-k\n * Based on jslzjb: https://code.google.com/p/jslzjb/\n * Heavily modified for speed\n */\n// Constants was used for compress/decompress function.\nconst\n/** @const */ NBBY = 8,\n /** @const */ MATCH_BITS = 6,\n /** @const */ MATCH_MIN = 3,\n /** @const */ MATCH_MAX = ((1 << MATCH_BITS) + (MATCH_MIN - 1)),\n /** @const */ OFFSET_MASK = ((1 << (16 - MATCH_BITS)) - 1),\n /** @const */ LEMPEL_SIZE = 256;\n\n/**\n * Because of weak of javascript's natural, many compression algorithm\n * become useless in javascript implementation. The main problem is\n * performance, even the simple Huffman, LZ77/78 algorithm will take many\n * many time to operate. We use LZJB algorithm to do that, it surprisingly\n * fulfills our requirement to compress string fastly and efficiently.\n *\n * Our implementation is based on\n * http://src.opensolaris.org/source/raw/onnv/onnv-gate/\n * usr/src/uts/common/os/compress.c\n * It is licensed under CDDL.\n *\n * Compress byte array using fast and efficient algorithm.\n *\n * @param {Uint8Array} sstart The buffer to compress\n * @param {Uint8Array} dstart The buffer to write into\n * @return {number} compressed length (number of bytes written to the\n * output buffer). May be bigger than the size of the\n * output buffer, in which case some bytes are lost\n */\nfunction compress(sstart, dstart) {\n var slen = 0,\n src = 0,\n dst = 0,\n cpy = 0,\n copymap = 0,\n copymask = 1 << (NBBY - 1),\n mlen = 0,\n offset = 0,\n hp = 0,\n lempel = new Int32Array(LEMPEL_SIZE),\n i = 0;\n\n // Initialize lempel array.\n for(i = 0; i < LEMPEL_SIZE; i++) {\n lempel[i] = -858993460;\n }\n\n slen = sstart.length;\n\n while (src < slen) {\n if ((copymask <<= 1) == (1 << NBBY)) {\n copymask = 1;\n copymap = dst;\n dstart[dst++] = 0;\n }\n\n if (src > slen - MATCH_MAX) {\n dstart[dst++] = sstart[src++];\n continue;\n }\n\n hp = ((sstart[src] + 13) ^\n (sstart[src + 1] - 13) ^\n sstart[src + 2]) &\n (LEMPEL_SIZE - 1);\n\n offset = (src - lempel[hp]) & OFFSET_MASK;\n lempel[hp] = src;\n cpy = src - offset;\n\n if (cpy >= 0 && cpy != src &&\n sstart[src] == sstart[cpy] &&\n sstart[src + 1] == sstart[cpy + 1] &&\n sstart[src + 2] == sstart[cpy + 2]) {\n dstart[copymap] |= copymask;\n for (mlen = MATCH_MIN; mlen < MATCH_MAX; mlen++)\n if (sstart[src + mlen] != sstart[cpy + mlen])\n break;\n dstart[dst++] = ((mlen - MATCH_MIN) << (NBBY - MATCH_BITS)) |\n (offset >> NBBY);\n dstart[dst++] = offset;\n src += mlen;\n } else {\n dstart[dst++] = sstart[src++];\n }\n }\n\n console.assert(sstart.length >= src);\n\n return dst;\n}\n\n/**\n * Our implementation is based on\n * http://src.opensolaris.org/source/raw/onnv/onnv-gate/\n * usr/src/uts/common/os/compress.c\n * It is licensed under CDDL.\n *\n * Decompress byte array using fast and efficient algorithm.\n *\n * @param {Uint8Array} sstart The buffer to decompress\n * @param {number} slen compressed length\n * @param {Uint8Array} dstart The buffer to write into\n * @return {number} decompressed length\n */\nfunction decompress(sstart, slen, dstart) {\n slen = slen | 0;\n\n var src = 0,\n dst = 0,\n cpy = 0,\n copymap = 0,\n copymask = 1 << (NBBY - 1 | 0),\n mlen = 0,\n offset = 0;\n\n //var avg_mlen = [];\n\n while (src < slen) {\n if ((copymask <<= 1) === (1 << NBBY)) {\n copymask = 1;\n copymap = sstart[src];\n src = src + 1 | 0;\n }\n\n if (copymap & copymask) {\n mlen = (sstart[src] >> (NBBY - MATCH_BITS | 0)) + MATCH_MIN | 0;\n offset = ((sstart[src] << NBBY) | sstart[src + 1 | 0]) & OFFSET_MASK;\n src = src + 2 | 0;\n\n cpy = dst - offset | 0;\n //if (cpy >= 0)\n {\n //console.log(mlen);\n //avg_mlen.push(mlen);\n\n //dstart.set(dstart.subarray(cpy, cpy + mlen | 0), dst);\n //dst = dst + mlen | 0;\n //cpy = cpy + mlen | 0;\n\n //mlen = mlen - 1 | 0;\n while (mlen > 4) {\n dstart[dst] = dstart[cpy];\n dst = dst + 1 | 0;\n cpy = cpy + 1 | 0;\n\n dstart[dst] = dstart[cpy];\n dst = dst + 1 | 0;\n cpy = cpy + 1 | 0;\n\n dstart[dst] = dstart[cpy];\n dst = dst + 1 | 0;\n cpy = cpy + 1 | 0;\n\n dstart[dst] = dstart[cpy];\n dst = dst + 1 | 0;\n cpy = cpy + 1 | 0;\n\n mlen = mlen - 4 | 0;\n }\n\n while (mlen > 0) {\n dstart[dst] = dstart[cpy];\n dst = dst + 1 | 0;\n cpy = cpy + 1 | 0;\n mlen = mlen - 1 | 0;\n }\n }\n //else\n //{\n // /*\n // * offset before start of destination buffer\n // * indicates corrupt source data\n // */\n // console.warn(\"possibly corrupt data\");\n // return dstart;\n //}\n } else {\n dstart[dst] = sstart[src];\n dst = dst + 1 | 0;\n src = src + 1 | 0;\n }\n }\n\n //console.log(avg_mlen.reduce(function(a, x) { return a + x; }, 0) / avg_mlen.length);\n\n //console.assert(dstart.length >= dst);\n //console.assert(sstart.length >= src);\n\n return dst;\n}\n\n\nfunction encode_magic() {\n const encoder = new TextEncoder('utf-8');\n return encoder.encode(MAGIC_STRING);\n}\n\nconst MAGIC_STRING = '@lzjb';\nconst MAGIC = encode_magic();\n\nfunction merge_uint8_array(...args) {\n if (args.length > 1) {\n const len = args.reduce((acc, arr) => acc + arr.length, 0);\n const result = new Uint8Array(len);\n let offset = 0;\n args.forEach(item => {\n result.set(item, offset);\n offset += item.length;\n });\n return result;\n } else if (args.length) {\n return args[0];\n }\n}\n\nfunction number_to_bytes(number) {\n const len = Math.ceil(Math.log2(number) / 8);\n const byteArray = new Uint8Array(len);\n\n for (let index = 0; index < byteArray.length; index ++ ) {\n const byte = number & 0xff;\n byteArray[index] = byte;\n number = (number - byte) / 256;\n }\n\n return byteArray;\n}\n\nfunction bytes_to_number(byteArray) {\n let result = 0;\n for (let i = byteArray.length - 1; i >= 0; i--) {\n result = (result * 256) + byteArray[i];\n }\n\n return result;\n}\n\nfunction pack(input, { magic = true } = {}) {\n const out = new Uint8Array(Math.max(input.length * 1.5 | 0, 16 * 1024));\n const len = compress(input, out);\n const len_array = number_to_bytes(input.length);\n const payload = [\n Uint8Array.of(len_array.length),\n len_array,\n out.slice(0, len)\n ];\n if (magic) {\n payload.unshift(MAGIC);\n }\n return merge_uint8_array(...payload);\n}\n\nfunction unpack(input, { magic = true } = {}) {\n if (magic) {\n const decoder = new TextDecoder('utf-8');\n const magic_prefix = decoder.decode(input.slice(0, MAGIC.length));\n if (magic_prefix !== MAGIC_STRING) {\n throw new Error('Invalid magic value');\n }\n }\n const magic_length = magic ? MAGIC.length : 0;\n const size = input[magic_length];\n const start = magic_length + 1;\n const end = magic_length + size + 1;\n const len = bytes_to_number(input.slice(start, end));\n input = input.slice(end);\n const out = new Uint8Array(len);\n decompress(input, input.length, out);\n return out;\n}\n\nexports.pack = pack;\nexports.unpack = unpack;\n","export default function(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||\"get\",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+\",\"+t:t}),t(a())},s.onerror=r,s.withCredentials=\"include\"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n","/**@license\n * __ __ __\n * / / \\ \\ _ _ ___ ___ \\ \\\n * | | \\ \\ | | | || . \\/ __> | |\n * | | > \\ | |_ | || _/\\__ \\ | |\n * | | / ^ \\ |___||_||_| <___/ | |\n * \\_\\ /_/ \\_\\ /_/\n *\n * \n *\n * LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript\n *\n * Copyright (c) 2018-2021 Jakub T. Jankiewicz \n * Released under the MIT license\n *\n * includes:\n *\n * ucs2decode function from Punycode v 2.1.1 by Mathias Bynens MIT License\n *\n * Author: Diego Perini (diego.perini at gmail.com)\n * Summary: cross-browser wrapper for DOMContentLoaded\n * Updated: 20101020\n * License: MIT\n * Version: 1.2\n *\n * contentloaded.js\n *\n * URL:\n * http://javascript.nwbox.com/ContentLoaded/\n * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE\n *\n * The rationalize algorithm is by Per M.A. Bothner, Alan Bawden and Marc Feeley.\n * source: Kawa, C-Gambit\n *\n * Build time: {{DATE}}\n */\n/*\n * TODO: consider using exec in env.eval or use different maybe_async code\n */\n/* global jQuery, BigInt, Map, Set, Symbol, importScripts, Uint8Array */\n\"use strict\";\n\nconst root = typeof global !== 'undefined' ? global : self;\n\nimport { addExtension, Encoder } from 'cbor-x';\nimport { pack, unpack } from 'lzjb-pack';\nimport unfetch from 'unfetch';\n\nif (!root.fetch) {\n root.fetch = unfetch;\n}\n\nlet fs, path, nodeRequire;\n\nconst BN = root.BN;\n\n/* eslint-disable */\n/* istanbul ignore next */\nfunction contentLoaded(win, fn) {\n var done = false, top = true,\n\n doc = win.document,\n root = doc.documentElement,\n modern = doc.addEventListener,\n\n add = modern ? 'addEventListener' : 'attachEvent',\n rem = modern ? 'removeEventListener' : 'detachEvent',\n pre = modern ? '' : 'on',\n\n init = function(e) {\n if (e.type == 'readystatechange' && doc.readyState != 'complete') return;\n (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false);\n if (!done && (done = true)) fn.call(win, e.type || e);\n },\n\n poll = function() {\n try { root.doScroll('left'); } catch(e) { setTimeout(poll, 50); return; }\n init('poll');\n };\n\n if (doc.readyState == 'complete') fn.call(win, 'lazy');\n else {\n if (!modern && root.doScroll) {\n try { top = !win.frameElement; } catch(e) { }\n if (top) poll();\n }\n doc[add](pre + 'DOMContentLoaded', init, false);\n doc[add](pre + 'readystatechange', init, false);\n win[add](pre + 'load', init, false);\n }\n}\n// -------------------------------------------------------------------------\n/* eslint-disable */\n/* istanbul ignore next */\nfunction log(x, regex = null) {\n var literal = arguments[1] === true;\n function msg(x) {\n if (!is_debug()) {\n return;\n }\n var value = global_env.get('repr')(x);\n if (regex === null || regex instanceof RegExp && regex.test(value)) {\n console.log(global_env.get('type')(x) + \": \" + value);\n }\n if (literal) {\n console.log(x);\n }\n }\n if (is_promise(x)) {\n x.then(msg);\n } else {\n msg(x);\n }\n return x;\n}\n// ----------------------------------------------------------------------\n/* istanbul ignore next */\nfunction is_debug() {\n return user_env && user_env.get('DEBUG', { throwError: false });\n}\n/* eslint-enable */\n/* eslint-disable max-len */\n// functions generate regexes to match number rational, integer, complex, complex+ratioanl\nfunction num_mnemicic_re(mnemonic) {\n return mnemonic ? `(?:#${mnemonic}(?:#[ie])?|#[ie]#${mnemonic})` : '(?:#[ie])?';\n}\nfunction gen_rational_re(mnemonic, range) {\n return `${num_mnemicic_re(mnemonic)}[+-]?${range}+/${range}+`;\n}\n// TODO: float complex\nfunction gen_complex_re(mnemonic, range) {\n // [+-]i have (?=..) so it don't match +i from +inf.0\n return `${num_mnemicic_re(mnemonic)}(?:[+-]?(?:${range}+/${range}+|nan.0|inf.0|${range}+))?(?:[+-]i|[+-]?(?:${range}+/${range}+|${range}+|nan.0|inf.0)i)(?=[()[\\\\]\\\\s]|$)`;\n}\nfunction gen_integer_re(mnemonic, range) {\n return `${num_mnemicic_re(mnemonic)}[+-]?${range}+`;\n}\nvar re_re = /^#\\/((?:\\\\\\/|[^/]|\\[[^\\]]*\\/[^\\]]*\\])+)\\/([gimyus]*)$/;\nvar float_stre = '(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\\\.[0-9]+|[0-9]+\\\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)|[0-9]+\\\\.)';\n// TODO: extend to ([+-]1/2|float)([+-]1/2|float)\nvar complex_float_stre = `(?:#[ie])?(?:[+-]?(?:[0-9]+/[0-9]+|nan.0|inf.0|${float_stre}|[+-]?[0-9]+))?(?:${float_stre}|[+-](?:[0-9]+/[0-9]+|[0-9]+|nan.0|inf.0))i`;\nvar float_re = new RegExp(`^(#[ie])?${float_stre}$`, 'i');\nfunction make_complex_match_re(mnemonic, range) {\n // complex need special treatment of 10e+1i when it's hex or decimal\n var neg = mnemonic === 'x' ? `(?!\\\\+|${range})` : `(?!\\\\.|${range})`;\n var fl = '';\n if (mnemonic === '') {\n fl = '(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\\\.[0-9]+|[0-9]+\\\\.[0-9]+(?![0-9]))(?:[eE][-+]?[0-9]+)?))';\n }\n return new RegExp(`^((?:(?:${fl}|[-+]?inf.0|[-+]?nan.0|[+-]?${range}+/${range}+(?!${range})|[+-]?${range}+)${neg})?)(${fl}|[-+]?inf.0|[-+]?nan.0|[+-]?${range}+/${range}+|[+-]?${range}+|[+-])i$`, 'i');\n}\nvar complex_list_re = (function() {\n var result = {};\n [\n [10, '', '[0-9]'],\n [16, 'x', '[0-9a-fA-F]'],\n [8, 'o', '[0-7]'],\n [2, 'b', '[01]']\n ].forEach(([radix, mnemonic, range]) => {\n result[radix] = make_complex_match_re(mnemonic, range);\n });\n return result;\n})();\nconst characters = {\n 'alarm': '\\x07',\n 'backspace': '\\x08',\n 'delete': '\\x7F',\n 'escape': '\\x1B',\n 'newline': '\\n',\n 'null': '\\x00',\n 'return': '\\r',\n 'space': ' ',\n 'tab': '\\t',\n // new symbols from ASCII table in SRFI-175\n 'dle': '\\x10',\n 'soh': '\\x01',\n 'dc1': '\\x11',\n 'stx': '\\x02',\n 'dc2': '\\x12',\n 'etx': '\\x03',\n 'dc3': '\\x13',\n 'eot': '\\x04',\n 'dc4': '\\x14',\n 'enq': '\\x05',\n 'nak': '\\x15',\n 'ack': '\\x06',\n 'syn': '\\x16',\n 'bel': '\\x07',\n 'etb': '\\x17',\n 'bs': '\\x08',\n 'can': '\\x18',\n 'ht': '\\x09',\n 'em': '\\x19',\n 'lf': '\\x0a',\n 'sub': '\\x1a',\n 'vt': '\\x0b',\n 'esc': '\\x1b',\n 'ff': '\\x0c',\n 'fs': '\\x1c',\n 'cr': '\\x0d',\n 'gs': '\\x1d',\n 'so': '\\x0e',\n 'rs': '\\x1e',\n 'si': '\\x0f',\n 'us': '\\x1f',\n 'del': '\\x7f'\n};\n// -------------------------------------------------------------------------\n// :: ref: https://github.com/bestiejs/punycode.js/blob/master/punycode.js\n// -------------------------------------------------------------------------\nfunction ucs2decode(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // It's a high surrogate, and there is a next character.\n const extra = string.charCodeAt(counter++);\n if ((extra & 0xFC00) === 0xDC00) { // Low surrogate.\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n}\n// -------------------------------------------------------------------------\nconst character_symbols = Object.keys(characters).join('|');\nconst char_sre_re = `#\\\\\\\\(?:x[0-9a-f]+|${character_symbols}|[\\\\s\\\\S])`;\nconst char_re = new RegExp(`^${char_sre_re}$`, 'i');\n// complex with (int) (float) (rational)\nfunction make_num_stre(fn) {\n const ranges = [\n ['o', '[0-7]'],\n ['x', '[0-9a-fA-F]'],\n ['b', '[01]'],\n ['d', '[0-9]'],\n ['', '[0-9]']\n ];\n // float exception that don't accept mnemonics\n let result = ranges.map(([m, range]) => fn(m, range)).join('|');\n if (fn === gen_complex_re) {\n result = complex_float_stre + '|' + result;\n }\n return result;\n}\nfunction make_type_re(fn) {\n return new RegExp('^(?:' + make_num_stre(fn) + ')$', 'i');\n}\nconst complex_re = make_type_re(gen_complex_re);\nconst rational_re = make_type_re(gen_rational_re);\nconst int_re = make_type_re(gen_integer_re);\n\n// regexes with full range but without mnemonics for string->number\nconst int_bare_re = new RegExp('^(?:' + gen_integer_re('', '[0-9a-f]') + ')$', 'i');\nconst rational_bare_re = new RegExp('^(?:' + gen_rational_re('', '[0-9a-f]') + ')$', 'i');\nconst complex_bare_re = new RegExp('^(?:' + gen_complex_re('', '[0-9a-f]') + ')$', 'i');\n\nconst complex_bare_match_re = make_complex_match_re('', '[0-9a-fA-F]');\n\nconst pre_num_parse_re = /((?:#[xodbie]){0,2})(.*)/i;\n/* eslint-enable */\nfunction num_pre_parse(arg) {\n var parts = arg.match(pre_num_parse_re);\n var options = {};\n if (parts[1]) {\n var type = parts[1].replace(/#/g, '').toLowerCase().split('');\n if (type.includes('x')) {\n options.radix = 16;\n } else if (type.includes('o')) {\n options.radix = 8;\n } else if (type.includes('b')) {\n options.radix = 2;\n } else if (type.includes('d')) {\n options.radix = 10;\n }\n if (type.includes('i')) {\n options.inexact = true;\n }\n if (type.includes('e')) {\n options.exact = true;\n }\n }\n options.number = parts[2];\n return options;\n}\n// ----------------------------------------------------------------------\nfunction parse_rational(arg, radix = 10) {\n var parse = num_pre_parse(arg);\n var parts = parse.number.split('/');\n var num = LRational({\n num: LNumber([parts[0], parse.radix || radix]),\n denom: LNumber([parts[1], parse.radix || radix])\n });\n if (parse.inexact) {\n return num.valueOf();\n } else {\n return num;\n }\n}\n// ----------------------------------------------------------------------\nfunction parse_integer(arg, radix = 10) {\n var parse = num_pre_parse(arg);\n if (parse.inexact) {\n return LFloat(parseInt(parse.number, parse.radix || radix), true);\n }\n return LNumber([parse.number, parse.radix || radix]);\n}\n// ----------------------------------------------------------------------\nfunction parse_character(arg) {\n var m = arg.match(/#\\\\x([0-9a-f]+)$/i);\n var char;\n if (m) {\n var ord = parseInt(m[1], 16);\n char = String.fromCodePoint(ord);\n } else {\n m = arg.match(/#\\\\(.+)$/);\n if (m) {\n char = m[1];\n }\n }\n if (char) {\n return LCharacter(char);\n }\n throw new Error('Parse: invalid character');\n}\n// ----------------------------------------------------------------------\nfunction parse_complex(arg, radix = 10) {\n function parse_num(n) {\n var value;\n if (n === '+') {\n value = LNumber(1);\n } else if (n === '-') {\n value = LNumber(-1);\n } else if (n.match(int_bare_re)) {\n value = LNumber([n, radix]);\n } else if (n.match(rational_bare_re)) {\n var parts = n.split('/');\n value = LRational({\n num: LNumber([parts[0], radix]),\n denom: LNumber([parts[1], radix])\n });\n } else if (n.match(float_re)) {\n var float = parse_float(n);\n if (parse.exact) {\n return float.toRational();\n }\n return float;\n } else if (n.match(/nan.0$/)) {\n return LNumber(NaN);\n } else if (n.match(/inf.0$/)) {\n if (n[0] === '-') {\n return LNumber(Number.NEGATIVE_INFINITY);\n }\n return LNumber(Number.POSITIVE_INFINITY);\n } else {\n throw new Error('Internal Parser Error');\n }\n if (parse.inexact) {\n return LFloat(value.valueOf(), true);\n }\n return value;\n }\n var parse = num_pre_parse(arg);\n radix = parse.radix || radix;\n var parts;\n var bare_match = parse.number.match(complex_bare_match_re);\n if (radix !== 10 && bare_match) {\n parts = bare_match;\n } else {\n parts = parse.number.match(complex_list_re[radix]);\n }\n var re, im;\n im = parse_num(parts[2]);\n if (parts[1]) {\n re = parse_num(parts[1]);\n } else {\n re = LNumber(0);\n }\n if (im.cmp(0) === 0 && im.__type__ === 'bigint') {\n return re;\n }\n return LComplex({ im, re });\n}\n// ----------------------------------------------------------------------\nfunction is_int(value) {\n return parseInt(value.toString(), 10) === value;\n}\n// ----------------------------------------------------------------------\nfunction parse_big_int(str) {\n var num_match = str.match(/^(([-+]?[0-9]*)(?:\\.([0-9]+))?)e([-+]?[0-9]+)/i);\n if (num_match) {\n var exponent = parseInt(num_match[4], 10);\n var mantisa;// = parseFloat(num_match[1]);\n var digits = num_match[1].replace(/[-+]?([0-9]*)\\..+$/, '$1').length;\n var decimal_points = num_match[3] && num_match[3].length;\n if (digits < Math.abs(exponent)) {\n mantisa = LNumber([num_match[1].replace(/\\./, ''), 10]);\n if (decimal_points) {\n exponent -= decimal_points;\n }\n }\n }\n return { exponent, mantisa };\n}\n// ----------------------------------------------------------------------\nfunction parse_float(arg) {\n var parse = num_pre_parse(arg);\n var value = parseFloat(parse.number);\n var simple_number = (parse.number.match(/\\.0$/) ||\n !parse.number.match(/\\./)) && !parse.number.match(/e/i);\n if (!parse.inexact) {\n if (parse.exact && simple_number) {\n return LNumber(value);\n }\n // positive big num that eval to int e.g.: 1.2e+20\n if (is_int(value) && parse.number.match(/e\\+?[0-9]/i)) {\n return LNumber(value);\n }\n // calculate big int and big fration by hand - it don't fit into JS float\n var { mantisa, exponent } = parse_big_int(parse.number);\n if (mantisa !== undefined && exponent !== undefined) {\n var factor = LNumber(10).pow(LNumber(Math.abs(exponent)));\n if (parse.exact && exponent < 0) {\n return LRational({ num: mantisa, denom: factor });\n } else if (exponent > 0) {\n return LNumber(mantisa).mul(factor);\n }\n }\n }\n value = LFloat(value, true);\n if (parse.exact) {\n return value.toRational();\n }\n return value;\n}\n// ----------------------------------------------------------------------\nfunction parse_string(string) {\n // handle non JSON escapes and skip unicode escape \\u (even partial)\n string = string.replace(/\\\\x([0-9a-f]+);/ig, function(_, hex) {\n return \"\\\\u\" + hex.padStart(4, '0');\n }).replace(/\\n/g, '\\\\n'); // in LIPS strings can be multiline\n var m = string.match(/(\\\\*)(\\\\x[0-9A-F])/i);\n if (m && m[1].length % 2 === 0) {\n throw new Error(`Invalid string literal, unclosed ${m[2]}`);\n }\n try {\n return LString(JSON.parse(string));\n } catch (e) {\n throw new Error('Invalid string literal');\n }\n}\n// ----------------------------------------------------------------------\nfunction parse_symbol(arg) {\n if (arg.match(/^\\|.*\\|$/)) {\n arg = arg.replace(/(^\\|)|(\\|$)/g, '');\n var chars = {\n t: '\\t',\n r: '\\r',\n n: '\\n'\n };\n arg = arg.replace(/\\\\(x[^;]+);/g, function(_, chr) {\n return String.fromCharCode(parseInt('0' + chr, 16));\n }).replace(/\\\\(.)/g, function(_, chr) {\n return chars[chr] || chr;\n });\n }\n return new LSymbol(arg);\n}\n// ----------------------------------------------------------------------\nfunction parse_argument(arg) {\n if (constants.hasOwnProperty(arg)) {\n return constants[arg];\n }\n if (arg.match(/^\"[\\s\\S]*\"$/)) {\n return parse_string(arg);\n } else if (arg[0] === '#') {\n var regex = arg.match(re_re);\n if (regex) {\n return new RegExp(regex[1], regex[2]);\n } else if (arg.match(char_re)) {\n return parse_character(arg);\n }\n // characters with more than one codepoint\n var m = arg.match(/#\\\\(.+)/);\n if (m && ucs2decode(m[1]).length === 1) {\n return parse_character(arg);\n }\n }\n if (arg.match(/[0-9a-f]|[+-]i/i)) {\n if (arg.match(int_re)) {\n return parse_integer(arg);\n } else if (arg.match(float_re)) {\n return parse_float(arg);\n } else if (arg.match(rational_re)) {\n return parse_rational(arg);\n } else if (arg.match(complex_re)) {\n return parse_complex(arg);\n }\n }\n if (arg.match(/^#[iexobd]/)) {\n throw new Error('Invalid numeric constant: ' + arg);\n }\n return parse_symbol(arg);\n}\n// ----------------------------------------------------------------------\nfunction is_atom_string(str) {\n return !(['(', ')', '[', ']'].includes(str) ||\n specials.names().includes(str));\n}\n// ----------------------------------------------------------------------\nfunction is_symbol_string(str) {\n return is_atom_string(str) &&\n !(str.match(re_re) ||\n str.match(/^\"[\\s\\S]*\"$/) || str.match(int_re) ||\n str.match(float_re) || str.match(complex_re) ||\n str.match(rational_re) || str.match(char_re) ||\n ['#t', '#f', 'nil', 'true', 'false'].includes(str));\n}\n// ----------------------------------------------------------------------\nvar string_re = /\"(?:\\\\[\\S\\s]|[^\"])*\"?/g;\n// ----------------------------------------------------------------------\nfunction escape_regex(str) {\n if (typeof str === 'string') {\n var special = /([-\\\\^$[\\]()+{}?*.|])/g;\n return str.replace(special, '\\\\$1');\n }\n return str;\n}\n// ----------------------------------------------------------------------\n// Stack used in balanced function\n// TODO: use it in parser\n// ----------------------------------------------------------------------\nfunction Stack() {\n this.data = [];\n}\nStack.prototype.push = function(item) {\n this.data.push(item);\n};\nStack.prototype.top = function() {\n return this.data[this.data.length - 1];\n};\nStack.prototype.pop = function() {\n return this.data.pop();\n};\nStack.prototype.is_empty = function() {\n return !this.data.length;\n};\n// ----------------------------------------------------------------------\nfunction tokens(str) {\n if (str instanceof LString) {\n str = str.valueOf();\n }\n var lexer = new Lexer(str, { whitespace: true });\n var result = [];\n while (true) {\n const token = lexer.peek(true);\n if (token === eof) {\n break;\n }\n result.push(token);\n lexer.skip();\n }\n return result;\n}\n// ----------------------------------------------------------------------\nfunction multiline_formatter(meta) {\n var { token, ...rest } = meta;\n if (token.match(/^\"[\\s\\S]*\"$/) && token.match(/\\n/)) {\n var re = new RegExp('^ {1,' + (meta.col + 1) + '}', 'mg');\n token = token.replace(re, '');\n }\n return {\n token,\n ...rest\n };\n}\n// ----------------------------------------------------------------------\nfunction Thunk(fn, cont = () => {}) {\n this.fn = fn;\n this.cont = cont;\n}\n// ----------------------------------------------------------------------\nThunk.prototype.toString = function() {\n return '#';\n};\n// ----------------------------------------------------------------------\nfunction trampoline(fn) {\n return function(...args) {\n return unwind(fn.apply(this, args));\n };\n}\n// ----------------------------------------------------------------------\nfunction unwind(result) {\n while (result instanceof Thunk) {\n const thunk = result;\n result = result.fn();\n if (!(result instanceof Thunk)) {\n thunk.cont();\n }\n }\n return result;\n}\n// ----------------------------------------------------------------------\nfunction tokenize(str, meta = false) {\n if (str instanceof LString) {\n str = str.toString();\n }\n if (meta) {\n return tokens(str);\n } else {\n var result = tokens(str).map(function(token) {\n // we don't want literal space character to be trimmed\n if (token.token === '#\\\\ ') {\n return token.token;\n }\n return token.token.trim();\n }).filter(function(token) {\n return token && !token.match(/^;/) && !token.match(/^#\\|[\\s\\S]*\\|#$/);\n });\n return strip_s_comments(result);\n }\n}\n// ----------------------------------------------------------------------\nfunction strip_s_comments(tokens) {\n var s_count = 0;\n var s_start = null;\n var remove_list = [];\n for (let i = 0; i < tokens.length; ++i) {\n const token = tokens[i];\n if (token === '#;') {\n if (['(', '['].includes(tokens[i + 1])) {\n s_count = 1;\n s_start = i;\n } else {\n remove_list.push([i, i + 2]);\n }\n i += 1;\n continue;\n }\n if (s_start !== null) {\n if ([')', ']'].includes(token)) {\n s_count--;\n } else if (['(', '['].includes(token)) {\n s_count++;\n }\n if (s_count === 0) {\n remove_list.push([s_start, i + 1]);\n s_start = null;\n }\n }\n }\n tokens = tokens.slice();\n remove_list.reverse();\n for (const [begin, end] of remove_list) {\n tokens.splice(begin, end - begin);\n }\n return tokens;\n}\n// ----------------------------------------------------------------------\n// detect if object is ES6 Symbol that work with polyfills\n// ----------------------------------------------------------------------\nfunction isSymbol(x) {\n return typeof x === 'symbol' ||\n typeof x === 'object' &&\n Object.prototype.toString.call(x) === '[object Symbol]';\n}\n// ----------------------------------------------------------------------\n// :: LSymbol constructor\n// ----------------------------------------------------------------------\nfunction LSymbol(name) {\n if (typeof this !== 'undefined' && this.constructor !== LSymbol ||\n typeof this === 'undefined') {\n return new LSymbol(name);\n }\n if (name instanceof LString) {\n name = name.valueOf();\n }\n if (LSymbol.list[name] instanceof LSymbol) {\n return LSymbol.list[name];\n }\n this.__name__ = name;\n if (typeof name === 'string') {\n LSymbol.list[name] = this;\n }\n}\nLSymbol.list = {};\nLSymbol.literal = Symbol.for('__literal__');\nLSymbol.object = Symbol.for('__object__');\n// ----------------------------------------------------------------------\nLSymbol.is = function(symbol, name) {\n return symbol instanceof LSymbol &&\n ((name instanceof LSymbol && symbol.__name__ === name.__name__) ||\n (typeof name === 'string' && symbol.__name__ === name) ||\n (name instanceof RegExp && name.test(symbol.__name__)));\n};\n// ----------------------------------------------------------------------\nLSymbol.prototype.toString = function(quote) {\n //return '#';\n if (isSymbol(this.__name__)) {\n return symbol_to_string(this.__name__);\n }\n var str = this.valueOf();\n // those special characters can be normal symbol when printed\n if (quote && str.match(/(^;|[\\s()[\\]'])/)) {\n return `|${str}|`;\n }\n return str;\n};\nLSymbol.prototype.literal = function() {\n if (this.is_gensym()) {\n return this[LSymbol.literal];\n }\n return this.valueOf();\n};\nLSymbol.prototype.serialize = function() {\n if (LString.isString(this.__name__)) {\n return this.__name__;\n }\n return [symbol_to_string(this.__name__)];\n};\nLSymbol.prototype.valueOf = function() {\n return this.__name__.valueOf();\n};\n// -------------------------------------------------------------------------\nLSymbol.prototype.is_gensym = function() {\n return is_gensym(this.__name__);\n};\n// -------------------------------------------------------------------------\nfunction symbol_to_string(obj) {\n return obj.toString().replace(/^Symbol\\(([^)]+)\\)/, '$1');\n}\n// -------------------------------------------------------------------------\nfunction is_gensym(symbol) {\n if (typeof symbol === 'symbol') {\n return !!symbol.toString().match(/^Symbol\\(#:/);\n }\n return false;\n}\n// -------------------------------------------------------------------------\nvar gensym = (function() {\n var count = 0;\n function with_props(name, sym) {\n var symbol = new LSymbol(sym);\n hidden_prop(symbol, '__literal__', name);\n return symbol;\n }\n return function(name = null) {\n if (name instanceof LSymbol) {\n if (name.is_gensym()) {\n return name;\n }\n name = name.valueOf();\n }\n if (is_gensym(name)) {\n // don't do double gynsyms in nested syntax-rules\n return LSymbol(name);\n }\n // use ES6 symbol as name for lips symbol (they are unique)\n if (name !== null) {\n return with_props(name, Symbol(`#:${name}`));\n }\n count++;\n return with_props(count, Symbol(`#:g${count}`));\n };\n})();\n// ----------------------------------------------------------------------\n// class used to escape promises feature #54\n// ----------------------------------------------------------------------\nfunction QuotedPromise(promise) {\n var internal = {\n pending: true,\n rejected: false,\n fulfilled: false,\n reason: undefined,\n type: undefined\n };\n // then added to __promise__ is needed otherwise rejection\n // will give UnhandledPromiseRejectionWarning in Node.js\n promise = promise.then(v => {\n internal.type = type(v);\n internal.fulfilled = true;\n internal.pending = false;\n return v;\n });\n // promise without catch, used for valueOf - for rejecting\n // that should throw an error when used with await\n read_only(this, '_promise', promise, { hidden: true });\n if (is_function(promise.catch)) {\n // prevent exception on unhandled rejecting when using\n // '>(Promise.reject (new Error \"zonk\")) in REPL\n promise = promise.catch((err) => {\n internal.rejected = true;\n internal.pending = false;\n internal.reason = err;\n });\n }\n Object.keys(internal).forEach(name => {\n Object.defineProperty(this, `__${name}__`, {\n enumerable: true,\n get: () => internal[name]\n });\n });\n read_only(this, '__promise__', promise);\n // prevent resolving when returned from real promise #153\n this.then = false;\n}\n// ----------------------------------------------------------------------\nQuotedPromise.prototype.then = function(fn) {\n return new QuotedPromise(this.valueOf().then(fn));\n};\n// ----------------------------------------------------------------------\nQuotedPromise.prototype.catch = function(fn) {\n return new QuotedPromise(this.valueOf().catch(fn));\n};\n// ----------------------------------------------------------------------\nQuotedPromise.prototype.valueOf = function() {\n if (!this._promise) {\n throw new Error('QuotedPromise: invalid promise created');\n }\n return this._promise;\n};\n// ----------------------------------------------------------------------\nQuotedPromise.prototype.toString = function() {\n if (this.__pending__) {\n return QuotedPromise.pending_str;\n }\n if (this.__rejected__) {\n return QuotedPromise.rejected_str;\n }\n return `#`;\n};\nQuotedPromise.pending_str = '#';\nQuotedPromise.rejected_str = '#';\n// ----------------------------------------------------------------------\n// wrapper over Promise.all that ignore quoted promises\n// ----------------------------------------------------------------------\nfunction promise_all(arg) {\n if (Array.isArray(arg)) {\n return Promise.all(escape_quoted_promises(arg))\n .then(unescape_quoted_promises);\n }\n return arg;\n}\n// ----------------------------------------------------------------------\nfunction escape_quoted_promises(array) {\n // using loops for performance\n var escaped = new Array(array.length), i = array.length;\n while (i--) {\n const value = array[i];\n if (value instanceof QuotedPromise) {\n escaped[i] = new Value(value);\n } else {\n escaped[i] = value;\n }\n }\n return escaped;\n}\n// ----------------------------------------------------------------------\nfunction unescape_quoted_promises(array) {\n var unescaped = new Array(array.length), i = array.length;\n while (i--) {\n var value = array[i];\n if (value instanceof Value) {\n unescaped[i] = value.valueOf();\n } else {\n unescaped[i] = value;\n }\n }\n return unescaped;\n}\n// ----------------------------------------------------------------------\n// :: Parser macros transformers\n// ----------------------------------------------------------------------\nvar specials = {\n LITERAL: Symbol.for('literal'),\n SPLICE: Symbol.for('splice'),\n SYMBOL: Symbol.for('symbol'),\n names: function() {\n return Object.keys(this._specials);\n },\n type: function(name) {\n return this.get(name).type;\n },\n get: function(name) {\n return this._specials[name];\n },\n // events are used in Lexer dynamic rules\n off: function(name, fn = null) {\n if (Array.isArray(name)) {\n name.forEach(name => this.off(name, fn));\n } else if (fn === null) {\n delete this._events[name];\n } else {\n this._events = this._events.filter(test => test !== fn);\n }\n },\n on: function(name, fn) {\n if (Array.isArray(name)) {\n name.forEach(name => this.on(name, fn));\n } else if (!this._events[name]) {\n this._events[name] = [fn];\n } else {\n this._events[name].push(fn);\n }\n },\n trigger: function(name, ...args) {\n if (this._events[name]) {\n this._events[name].forEach(fn => fn(...args));\n }\n },\n remove: function(name) {\n this.trigger('remove');\n delete this._specials[name];\n },\n append: function(name, value, type) {\n this.trigger('append');\n this._specials[name] = {\n seq: name,\n symbol: value,\n type\n };\n },\n _events: {},\n _specials: {}\n};\nfunction is_special(token) {\n return specials.names().includes(token);\n}\nfunction is_builtin(token) {\n return specials.builtin.includes(token);\n}\nfunction is_literal(special) {\n return specials.type(special) === specials.LITERAL;\n}\n// ----------------------------------------------------------------------\nvar defined_specials = [\n [\"'\", new LSymbol('quote'), specials.LITERAL],\n ['`', new LSymbol('quasiquote'), specials.LITERAL],\n [',@', new LSymbol('unquote-splicing'), specials.LITERAL],\n [',', new LSymbol('unquote'), specials.LITERAL],\n [\"'>\", new LSymbol('quote-promise'), specials.LITERAL]\n];\nObject.defineProperty(specials, 'builtin', {\n writable: false,\n value: defined_specials.map(arr => arr[0])\n});\ndefined_specials.forEach(([seq, symbol, type]) => {\n specials.append(seq, symbol, type);\n});\n// ----------------------------------------------------------------------\n// :: Finite State Machine based incremental Lexer\n// ----------------------------------------------------------------------\n/* Lexer debugger\n var DEBUG = false;\n function log(...args) {\n if (DEBUG) {\n console.log(...args);\n }\n }\n*/\nclass Lexer {\n constructor(input, { whitespace = false } = {}) {\n read_only(this, '__input__', input.replace(/\\r/g, ''));\n var internals = {};\n // hide internals from introspection\n [\n '_i', '_whitespace', '_col', '_newline', '_line',\n '_state', '_next', '_token', '_prev_char'\n ].forEach(name => {\n Object.defineProperty(this, name, {\n configurable: false,\n enumerable: false,\n get() {\n return internals[name];\n },\n set(value) {\n internals[name] = value;\n }\n });\n });\n this._whitespace = whitespace;\n this._i = this._line = this._col = this._newline = 0;\n this._state = this._next = this._token = null;\n this._prev_char = '';\n }\n get(name) {\n return this.__internal[name];\n }\n set(name, value) {\n this.__internal[name] = value;\n }\n token(meta = false) {\n if (meta) {\n let line = this._line;\n if (this._whitespace && this._token === '\\n') {\n --line;\n }\n return {\n token: this._token,\n col: this._col,\n offset: this._i,\n line\n };\n }\n return this._token;\n }\n peek(meta = false) {\n if (this._i >= this.__input__.length) {\n return eof;\n }\n if (this._token) {\n return this.token(meta);\n }\n var found = this.next_token();\n if (found) {\n this._token = this.__input__.substring(this._i, this._next);\n return this.token(meta);\n }\n return eof;\n }\n skip() {\n if (this._next !== null) {\n this._token = null;\n this._i = this._next;\n }\n }\n read_line() {\n var len = this.__input__.length;\n if (this._i >= len) {\n return eof;\n }\n for (let i = this._i; i < len; ++i) {\n var char = this.__input__[i];\n if (char === '\\n') {\n const line = this.__input__.substring(this._i, i);\n this._i = i + 1;\n ++this._line;\n return line;\n }\n }\n return this.read_rest();\n }\n read_rest() {\n const i = this._i;\n this._i = this.__input__.length;\n return this.__input__.substring(i);\n }\n read_string(num) {\n const len = this.__input__.length;\n if (this._i >= len) {\n return eof;\n }\n if (num + this._i >= len) {\n return this.read_rest();\n }\n const end = this._i + num;\n const result = this.__input__.substring(this._i, end);\n const found = result.match(/\\n/g);\n if (found) {\n this._line += found.length;\n }\n this._i = end;\n return result;\n }\n peek_char() {\n if (this._i >= this.__input__.length) {\n return eof;\n }\n return LCharacter(this.__input__[this._i]);\n }\n read_char() {\n const char = this.peek_char();\n this.skip_char();\n return char;\n }\n skip_char() {\n if (this._i < this.__input__.length) {\n ++this._i;\n this._token = null;\n }\n }\n match_rule(rule, { prev_char, char, next_char } = {}) {\n var [ re, prev_re, next_re, state ] = rule;\n if (rule.length !== 5) {\n throw new Error(`Lexer: Invalid rule of length ${rule.length}`);\n }\n if (!char.match(re)) {\n return false;\n }\n if (!match_or_null(prev_re, prev_char)) {\n return false;\n }\n if (!match_or_null(next_re, next_char)) {\n return false;\n }\n if (state !== this._state) {\n return false;\n }\n return true;\n }\n next_token() {\n if (this._i >= this.__input__.length) {\n return false;\n }\n var start = true;\n loop:\n for (let i = this._i, len = this.__input__.length; i < len; ++i) {\n var char = this.__input__[i];\n var prev_char = this.__input__[i - 1] || '';\n var next_char = this.__input__[i + 1] || '';\n if (char === '\\n') {\n ++this._line;\n const newline = this._newline;\n if (this._state === null) {\n // keep beging of newline to calculate col\n // we don't want to check inside the token (e.g. strings)\n this._newline = i + 1;\n }\n if (this._whitespace && this._state === null) {\n this._next = i + 1;\n this._col = this._i - newline;\n return true;\n }\n }\n // skip leadning spaces\n if (start && this._state === null && char.match(/\\s/)) {\n if (this._whitespace) {\n if (!next_char.match(/\\s/)) {\n this._next = i + 1;\n this._col = this._i - this._newline;\n return true;\n } else {\n continue;\n }\n } else {\n this._i = i + 1;\n continue;\n }\n }\n start = false;\n for (let rule of Lexer.rules) {\n if (this.match_rule(rule, { prev_char, char, next_char })) {\n // change state to null is end of the token\n var next_state = rule[rule.length - 1];\n this._state = next_state;\n if (this._state === null) {\n this._next = i + 1;\n this._col = this._i - this._newline;\n return true;\n }\n // token is activated\n continue loop;\n }\n }\n if (this._state !== null) {\n // collect char in token\n continue loop;\n }\n // no rule for token\n var line = this.__input__.split('\\n')[this._line];\n throw new Error(`Invalid Syntax at line ${this._line}\\n${line}`);\n }\n }\n}\n// ----------------------------------------------------------------------\n// TODO: cache the rules creation or whole list\n// ----------------------------------------------------------------------\nLexer.symbol_rule = function symbol_rule(string, symbol) {\n var rules = Lexer.literal_rule(string, symbol, Lexer.boundary, /\\S/);\n\n return rules.concat([\n [/\\S/, /\\S/, Lexer.boundary, null, null],\n [/\\S/, /\\S/, null, null, Lexer.symbol],\n [/\\S/, null, Lexer.boundary, Lexer.symbol, null]\n ]);\n};\n// ----------------------------------------------------------------------\n// state rule for literal symbol\n// ----------------------------------------------------------------------\nLexer.literal_rule = function literal_rule(string, symbol, p_re = null, n_re = null) {\n if (string.length === 0) {\n throw new Error('Lexer: invalid literal rule');\n }\n if (string.length === 1) {\n return [[string, p_re, n_re, null, null]];\n }\n var rules = [];\n for (let i = 0, len = string.length; i < len; ++i) {\n const rule = [];\n rule.push(string[i]);\n rule.push(string[i - 1] || p_re);\n rule.push(string[i + 1] || n_re);\n if (i === 0) {\n rule.push(null);\n rule.push(symbol);\n } else if (i === len - 1) {\n rule.push(symbol);\n rule.push(null);\n } else {\n rule.push(symbol);\n rule.push(symbol);\n }\n rules.push(rule);\n }\n return rules;\n};\n// ----------------------------------------------------------------------\nLexer.string = Symbol.for('string');\nLexer.symbol = Symbol.for('symbol');\nLexer.comment = Symbol.for('comment');\nLexer.regex = Symbol.for('regex');\nLexer.regex_class = Symbol.for('regex_class');\nLexer.character = Symbol.for('character');\nLexer.bracket = Symbol.for('bracket');\nLexer.b_symbol = Symbol.for('b_symbol');\nLexer.b_comment = Symbol.for('b_comment');\nLexer.i_comment = Symbol.for('i_comment');\nLexer.l_datum = Symbol.for('l_datum');\nLexer.dot = Symbol.for('dot');\n// ----------------------------------------------------------------------\nLexer.boundary = /^$|[\\s()[\\]']/;\n// ----------------------------------------------------------------------\nLexer._rules = [\n // char_re prev_re next_re from_state to_state\n // null as to_state mean that is single char token\n // string\n [/\"/, /^$|[^\\\\]/, null, null, Lexer.string],\n [/\"/, /^$|[^\\\\]/, null, Lexer.string, null],\n\n // hash special symbols, lexer don't need to distinguish those\n // we only care if it's not pick up by vectors literals\n [/#/, null, /[bdxoeitf]/i, null, Lexer.symbol],\n\n // characters\n [/#/, null, /\\\\/, null, Lexer.character],\n [/\\\\/, /#/, /\\s/, Lexer.character, Lexer.character],\n [/\\\\/, /#/, /[()[\\]]/, Lexer.character, Lexer.character],\n [/\\s/, /\\\\/, null, Lexer.character, null],\n [/\\S/, null, Lexer.boundary, Lexer.character, null],\n\n // regex\n [/#/, Lexer.boundary, /\\//, null, Lexer.regex],\n [/[ \\t]/, null, null, Lexer.regex, Lexer.regex],\n [/\\[/, null, null, Lexer.regex, Lexer.regex_class],\n [/\\]/, /[^\\\\]/, null, Lexer.regex_class, Lexer.regex],\n [/[()[\\]]/, null, null, Lexer.regex, Lexer.regex],\n [/\\//, /\\\\/, null, Lexer.regex, Lexer.regex],\n [/\\//, /[^#]/, Lexer.boundary, Lexer.regex, null],\n [/[gimyus]/, /\\//, Lexer.boundary, Lexer.regex, null],\n [/[gimyus]/, /\\//, /[gimyus]/, Lexer.regex, Lexer.regex],\n [/[gimyus]/, /[gimyus]/, Lexer.boundary, Lexer.regex, null],\n\n // comment\n [/;/, /^$|[^#]/, null, null, Lexer.comment],\n [/[\\s\\S]/, null, /\\n/, Lexer.comment, null],\n [/\\s/, null, null, Lexer.comment, Lexer.comment],\n\n // block comment\n [/#/, null, /\\|/, null, Lexer.b_comment],\n [/\\s/, null, null, Lexer.b_comment, Lexer.b_comment],\n [/#/, /\\|/, null, Lexer.b_comment, null],\n\n // inline commentss\n [/#/, null, /;/, null, Lexer.i_comment],\n [/;/, /#/, null, Lexer.i_comment, null],\n\n // datum label\n [/#/, null, /[0-9]/, null, Lexer.l_datum],\n [/=/, /[0-9]/, null, Lexer.l_datum, null],\n [/#/, /[0-9]/, null, Lexer.l_datum, null],\n\n // for dot comma `(a .,b)\n [/\\./, Lexer.boundary, /,/, null, null],\n\n // block symbols\n [/\\|/, null, null, null, Lexer.b_symbol],\n [/\\s/, null, null, Lexer.b_symbol, Lexer.b_symbol],\n [/\\|/, null, Lexer.boundary, Lexer.b_symbol, null]\n];\n// ----------------------------------------------------------------------\nLexer._brackets = [\n [/[()[\\]]/, null, null, null, null]\n];\n// ----------------------------------------------------------------------\n// :: symbols should be matched last\n// ----------------------------------------------------------------------\nLexer._symbol_rules = [\n [/\\S/, Lexer.boundary, Lexer.boundary, null, null],\n [/\\S/, Lexer.boundary, null, null, Lexer.symbol],\n [/\\S/, null, Lexer.boundary, null, null],\n [/\\S/, null, null, null, Lexer.symbol],\n [/\\S/, null, Lexer.boundary, Lexer.symbol, null]\n];\n// ----------------------------------------------------------------------\n// :: dynamic getter or Lexer state rules, parser use this\n// :: so in fact user code can modify lexer using syntax extensions\n// ----------------------------------------------------------------------\nLexer._cache = {\n valid: false,\n rules: null\n};\n// ----------------------------------------------------------------------\nspecials.on(['remove', 'append'], function() {\n Lexer._cache.valid = false;\n Lexer._cache.rules = null;\n});\n// ----------------------------------------------------------------------\nObject.defineProperty(Lexer, 'rules', {\n get() {\n if (Lexer._cache.valid) {\n return Lexer._cache.rules;\n }\n var tokens = specials.names().sort((a, b) => {\n return b.length - a.length || a.localeCompare(b);\n });\n\n var special_rules = tokens.reduce((acc, token) => {\n const { type, symbol: special_symbol } = specials.get(token);\n let rules;\n let symbol;\n // we need distinct symbols_ for syntax extensions\n if (token[0] === '#') {\n if (token.length === 1) {\n symbol = Symbol.for(token);\n } else {\n symbol = Symbol.for(token[1]);\n }\n } else {\n symbol = special_symbol;\n }\n if (type === specials.SYMBOL) {\n rules = Lexer.symbol_rule(token, symbol);\n } else {\n rules = Lexer.literal_rule(token, symbol);\n }\n return acc.concat(rules);\n }, []);\n\n Lexer._cache.rules = Lexer._rules.concat(\n Lexer._brackets,\n special_rules,\n Lexer._symbol_rules\n );\n\n Lexer._cache.valid = true;\n return Lexer._cache.rules;\n }\n});\n// ----------------------------------------------------------------------\nfunction match_or_null(re, char) {\n return re === null || char.match(re);\n}\n// ----------------------------------------------------------------------\n// :: Parser inspired by BiwaScheme\n// :: ref: https://github.com/biwascheme/biwascheme/blob/master/src/system/parser.js\n// ----------------------------------------------------------------------\nclass Parser {\n constructor(arg, { env, meta = false, formatter = multiline_formatter } = {}) {\n if (arg instanceof LString) {\n arg = arg.toString();\n }\n\n read_only(this, '_formatter', formatter, { hidden: true });\n read_only(this, '__lexer__', new Lexer(arg));\n read_only(this, '__env__', env);\n\n read_only(this, '_meta', meta, { hidden: true });\n // datum labels\n read_only(this, '_refs', [], { hidden: true });\n }\n resolve(name) {\n return this.__env__ && this.__env__.get(name, { throwError: false });\n }\n async peek() {\n let token;\n while (true) {\n token = this.__lexer__.peek(true);\n if (token === eof) {\n return eof;\n }\n if (this.is_comment(token.token)) {\n this.skip();\n continue;\n }\n if (token.token === '#;') {\n this.skip();\n if (this.__lexer__.peek() === eof) {\n throw new Error('Lexer: syntax error eof found after comment');\n }\n await this._read_object();\n continue;\n }\n break;\n }\n token = this._formatter(token);\n if (this._meta) {\n return token;\n }\n return token.token;\n }\n reset() {\n this._refs.length = 0;\n }\n skip() {\n this.__lexer__.skip();\n }\n async read() {\n const token = await this.peek();\n this.skip();\n return token;\n }\n match_datum_label(token) {\n var m = token.match(/^#([0-9]+)=$/);\n return m && m[1];\n }\n match_datum_ref(token) {\n var m = token.match(/^#([0-9]+)#$/);\n return m && m[1];\n }\n is_open(token) {\n return ['(', '['].includes(token);\n }\n is_close(token) {\n return [')', ']'].includes(token);\n }\n async read_list() {\n let head = nil, prev = head;\n while (true) {\n const token = await this.peek();\n if (token === eof) {\n break;\n }\n if (this.is_close(token)) {\n this.skip();\n break;\n }\n if (token === '.' && head !== nil) {\n this.skip();\n prev.cdr = await this._read_object();\n } else {\n const cur = new Pair(await this._read_object(), nil);\n if (head === nil) {\n head = cur;\n } else {\n prev.cdr = cur;\n }\n prev = cur;\n }\n }\n return head;\n }\n async read_value() {\n var token = await this.read();\n if (token === eof) {\n throw new Error('Parser: Expected token eof found');\n }\n return parse_argument(token);\n }\n is_comment(token) {\n return token.match(/^;/) || (token.match(/^#\\|/) && token.match(/\\|#$/));\n }\n evaluate(code) {\n return evaluate(code, { env: this.__env__, error: (e) => {\n throw e;\n } });\n }\n // public API that handle R7RS datum labels\n async read_object() {\n this.reset();\n var object = await this._read_object();\n if (object instanceof DatumReference) {\n object = object.valueOf();\n }\n if (this._refs.length) {\n return this._resolve_object(object);\n }\n return object;\n }\n async _resolve_object(object) {\n if (Array.isArray(object)) {\n return object.map(item => this._resolve_object(item));\n }\n if (is_plain_object(object)) {\n var result = {};\n Object.keys(object).forEach(key => {\n result[key] = this._resolve_object(object[key]);\n });\n return result;\n }\n if (object instanceof Pair) {\n return this._resolve_pair(object);\n }\n return object;\n }\n async _resolve_pair(pair) {\n if (pair instanceof Pair) {\n if (pair.car instanceof DatumReference) {\n pair.car = await pair.car.valueOf();\n } else {\n this._resolve_pair(pair.car);\n }\n if (pair.cdr instanceof DatumReference) {\n pair.cdr = await pair.cdr.valueOf();\n } else {\n this._resolve_pair(pair.cdr);\n }\n }\n return pair;\n }\n async _read_object() {\n const token = await this.peek();\n if (token === eof) {\n return token;\n }\n if (is_special(token)) {\n // builtin parser extensions are mapping short symbol to longer symbol\n // that can be function or macro, parser don't care\n // if it's not builtin then the extension can be macro or function\n // FUNCTION: when it's used it get arguments like FEXPR and\n // result is returned by parser as is\n // MACRO: if macros are used they are evaluated in place and\n // result is returned by parser but they are quoted\n const special = specials.get(token);\n const builtin = is_builtin(token);\n this.skip();\n let expr;\n const object = await this._read_object();\n if (!builtin) {\n var extension = this.__env__.get(special.symbol);\n if (typeof extension === 'function') {\n if (is_literal(token)) {\n return extension.call(this.__env__, object);\n } else if (object instanceof Pair) {\n return extension.apply(this.__env__, object.to_array(false));\n }\n throw new Error('Parse Error: Invalid parser extension ' +\n `invocation ${special.symbol}`);\n }\n }\n if (is_literal(token)) {\n expr = new Pair(\n special.symbol,\n new Pair(\n object,\n nil\n )\n );\n } else {\n expr = new Pair(\n special.symbol,\n object\n );\n }\n // builtin parser extensions just expand into lists like 'x ==> (quote x)\n if (builtin) {\n return expr;\n }\n // evaluate parser extension at parse time\n if (extension instanceof Macro) {\n var result = await this.evaluate(expr);\n // we need literal quote to make macro that return pair works\n // because after parser return the value it will be evaluated again\n // by the interpreter, so we create quoted expression\n if (result instanceof Pair || result instanceof LSymbol) {\n return Pair.fromArray([LSymbol('quote'), result]);\n }\n return result;\n } else {\n throw new Error('Parse Error: invalid parser extension: ' +\n special.symbol);\n }\n }\n var ref = this.match_datum_ref(token);\n if (ref !== null) {\n this.skip();\n if (this._refs[ref]) {\n return new DatumReference(ref, this._refs[ref]);\n }\n throw new Error(`Parse Error: invalid datum label #${ref}#`);\n }\n var ref_label = this.match_datum_label(token);\n if (ref_label !== null) {\n this.skip();\n this._refs[ref_label] = this._read_object();\n return this._refs[ref_label];\n } else if (this.is_open(token)) {\n this.skip();\n return this.read_list();\n } else {\n return this.read_value();\n }\n }\n}\n// ----------------------------------------------------------------------\n// :: parser helper that allow to handle circular list structures\n// :: using datum labels\n// ----------------------------------------------------------------------\nclass DatumReference {\n constructor(name, data) {\n this.name = name;\n this.data = data;\n }\n valueOf() {\n return this.data;\n }\n}\n// ----------------------------------------------------------------------\n// :: tokens are the array of strings from tokenizer\n// :: the return value is array of lisp code created out of Pair class\n// :: env is needed for parser extensions that will invoke the function\n// :: or macro assigned to symbol, this function is async because\n// :: it evaluate the code, from parser extensions, that may return promise\n// ----------------------------------------------------------------------\nasync function* parse(arg, env) {\n if (!env) {\n if (global_env) {\n env = global_env.get('**interaction-environment**', {\n throwError: false\n });\n } else {\n env = user_env;\n }\n }\n const parser = new Parser(arg, { env });\n while (true) {\n const expr = await parser.read_object();\n if (expr === eof) {\n break;\n }\n yield expr;\n }\n}\n// ----------------------------------------------------------------------\nfunction unpromise(value, fn = x => x, error = null) {\n if (is_promise(value)) {\n var ret = value.then(fn);\n if (error === null) {\n return ret;\n } else {\n return ret.catch(error);\n }\n }\n if (value instanceof Array) {\n return unpromise_array(value, fn, error);\n }\n if (is_plain_object(value)) {\n return unpromise_object(value, fn, error);\n }\n return fn(value);\n}\n// ----------------------------------------------------------------------\nfunction unpromise_array(array, fn, error) {\n if (array.find(is_promise)) {\n return unpromise(promise_all(array), (arr) => {\n if (Object.isFrozen(array)) {\n Object.freeze(arr);\n }\n return arr;\n }, error);\n }\n return fn(array);\n}\n// ----------------------------------------------------------------------\nfunction unpromise_object(object, fn, error) {\n const keys = Object.keys(object);\n const values = [], anyPromise = [];\n let i = keys.length;\n while (i--) {\n const key = keys[i];\n const value = object[key];\n values[i] = value;\n if (is_promise(value)) {\n anyPromise.push(value);\n }\n }\n if (anyPromise.length) {\n return unpromise(promise_all(values), (values) => {\n const result = {};\n values.forEach((value, i) => {\n const key = keys[i];\n result[key] = value;\n });\n if (Object.isFrozen(object)) {\n Object.freeze(result);\n }\n return result;\n }, error);\n }\n return fn(object);\n}\n// ----------------------------------------------------------------------\nfunction read_only(object, property, value, { hidden = false } = {}) {\n Object.defineProperty(object, property, {\n value,\n configurable: true,\n enumerable: !hidden\n });\n}\n// ----------------------------------------------------------------------\n// :: Function similar to Array.from that work on async iterators\n// ----------------------------------------------------------------------\nasync function uniterate_async(object) {\n const result = [];\n for await (let item of object) {\n result.push(item);\n }\n return result;\n}\n// ----------------------------------------------------------------------\n// :: function that return mather function that match string against string\n// ----------------------------------------------------------------------\nfunction matcher(name, arg) {\n if (arg instanceof RegExp) {\n return x => String(x).match(arg);\n } else if (is_function(arg)) {\n // it will always be function\n return arg;\n }\n throw new Error('Invalid matcher');\n}\n// ----------------------------------------------------------------------\n// :: documentation decorator to LIPS functions if lines starts with :\n// :: they are ignored (not trim) otherwise it trim so\n// :: so you can have indent in source code\n// ----------------------------------------------------------------------\nfunction doc(name, fn, doc, dump) {\n if (typeof name !== 'string') {\n fn = arguments[0];\n doc = arguments[1];\n dump = arguments[2];\n name = null;\n }\n if (doc) {\n if (dump) {\n fn.__doc__ = doc;\n } else {\n fn.__doc__ = trim_lines(doc);\n }\n }\n if (name) {\n fn.__name__ = name;\n } else if (fn.name && !is_lambda(fn)) {\n fn.__name__ = fn.name;\n }\n return fn;\n}\n// ----------------------------------------------------------------------\nfunction trim_lines(string) {\n return string.split('\\n').map(line => {\n return line.trim();\n }).join('\\n');\n}\n// ----------------------------------------------------------------------\n// return last S-Expression\n// @param tokens - array of tokens (objects from tokenizer or strings)\n// @param sexp - number of expression to look behind\n// ----------------------------------------------------------------------\nfunction previousSexp(tokens, sexp = 1) {\n var i = tokens.length;\n if (sexp <= 0) {\n throw Error(`previousSexp: Invalid argument sexp = ${sexp}`);\n }\n outer: while (sexp-- && i >= 0) {\n var count = 1;\n while (count > 0) {\n var token = tokens[--i];\n if (!token) {\n break outer;\n }\n if (token === '(' || token.token === '(') {\n count--;\n } else if (token === ')' || token.token === ')') {\n count++;\n }\n }\n i--;\n }\n return tokens.slice(i + 1);\n}\n// ----------------------------------------------------------------------\n// :: find number of spaces in line\n// ----------------------------------------------------------------------\nfunction lineIndent(tokens) {\n if (!tokens || !tokens.length) {\n return 0;\n }\n var i = tokens.length;\n if (tokens[i - 1].token === '\\n') {\n return 0;\n }\n while (--i) {\n if (tokens[i].token === '\\n') {\n var token = (tokens[i + 1] || {}).token;\n if (token) {\n return token.length;\n }\n }\n }\n return 0;\n}\n// ----------------------------------------------------------------------\n// :: token based pattern matching (used by formatter)\n// ----------------------------------------------------------------------\n/*\n function nested_pattern(pattern) {\n return pattern instanceof Array ||\n pattern instanceof Pattern;\n }\n*/\n// ----------------------------------------------------------------------\nfunction match(pattern, input) {\n return inner_match(pattern, input) === input.length;\n function inner_match(pattern, input) {\n /*\n function empty_match() {\n if (p <= 0 && i <= 0) {\n return false;\n }\n var prev_pattern = pattern[p - 1];\n if (!nested_pattern(prev_pattern)) {\n prev_pattern = [prev_pattern];\n }\n var next_pattern = pattern[p + 1];\n if (next_pattern && !nested_pattern(next_pattern)) {\n next_pattern = [next_pattern];\n }\n return match(prev_pattern, [input[i - 1]]) &&\n (!next_pattern || match(next_pattern, [input[i]]));\n }\n */\n function get_first_match(patterns, input) {\n for (let p of patterns) {\n const m = inner_match(p, input);\n if (m !== -1) {\n return m;\n }\n }\n return -1;\n }\n function not_symbol_match() {\n return pattern[p] === Symbol.for('symbol') && !is_symbol_string(input[i]);\n }\n function match_next() {\n var next_pattern = pattern[p + 1];\n var next_input = input[i + 1];\n if (next_pattern !== undefined && next_input !== undefined) {\n return inner_match([next_pattern], [next_input]);\n }\n }\n var p = 0;\n var glob = {};\n for (var i = 0; i < input.length; ++i) {\n if (typeof pattern[p] === 'undefined') {\n return i;\n }\n if (pattern[p] instanceof Pattern) {\n var m;\n if (['+', '*'].includes(pattern[p].flag)) {\n while (i < input.length) {\n m = get_first_match(pattern[p].patterns, input.slice(i));\n if (m === -1) {\n break;\n }\n i += m;\n }\n i -= 1;\n p++;\n continue;\n } else if (pattern[p].flag === '?') {\n m = get_first_match(pattern[p].patterns, input.slice(i));\n if (m === -1) {\n i -= 2; // if not found use same test on same input again\n } else {\n p++;\n }\n continue;\n }\n } else if (pattern[p] instanceof RegExp) {\n if (!input[i].match(pattern[p])) {\n return -1;\n }\n } else if (lips.LString.isString(pattern[p])) {\n if (pattern[p].valueOf() !== input[i]) {\n return -1;\n }\n } else if (typeof pattern[p] === 'symbol') {\n if (pattern[p] === Symbol.for('*')) {\n // ignore S-expressions inside for case when next pattern is )\n glob[p] = glob[p] || 0;\n //var zero_match = empty_match();\n if (['(', '['].includes(input[i])) {\n glob[p]++;\n } else if ([')', ']'].includes(input[i])) {\n glob[p]--;\n }\n if ((typeof pattern[p + 1] !== 'undefined' &&\n glob[p] === 0 && match_next() === -1) ||\n glob[p] > 0) {\n continue;\n }\n } else if (not_symbol_match()) {\n return -1;\n }\n } else if (pattern[p] instanceof Array) {\n var inc = inner_match(pattern[p], input.slice(i));\n if (inc === -1 || inc + i > input.length) {\n // if no more input it's not match\n return -1;\n }\n i += inc - 1;\n p++;\n continue;\n } else {\n return -1;\n }\n p++;\n }\n if (pattern.length !== p) {\n // if there are still patterns it's not match\n return -1;\n }\n return input.length;\n }\n}\n// ----------------------------------------------------------------------\n// :: Code formatter class\n// :: based on http://community.schemewiki.org/?scheme-style\n// :: and GNU Emacs scheme mode\n// :: it rely on meta data from tokenizer function\n// ----------------------------------------------------------------------\nfunction Formatter(code) {\n this.__code__ = code.replace(/\\r/g, '');\n}\n// ----------------------------------------------------------------------\nFormatter.defaults = {\n offset: 0,\n indent: 2,\n exceptions: {\n specials: [\n /* eslint-disable max-len */\n /^(?:#:)?(?:define(?:-values|-syntax|-macro|-class|-record-type)?|(?:call-with-(?:input-file|output-file|port))|lambda|let-env|try|catch|when|unless|while|syntax-rules|(let|letrec)(-syntax|\\*)?)$/\n /* eslint-enable */\n ],\n shift: {\n 1: ['&', '#']\n }\n }\n};\nFormatter.match = match;\n// ----------------------------------------------------------------------\n// :: return indent for next line\n// ----------------------------------------------------------------------\nFormatter.prototype._options = function _options(options) {\n var defaults = Formatter.defaults;\n if (typeof options === 'undefined') {\n return Object.assign({}, defaults);\n }\n var exceptions = options && options.exceptions || {};\n var specials = exceptions.specials || [];\n var shift = exceptions.shift || { 1: [] };\n return {\n ...defaults,\n ...options,\n exceptions: {\n specials: [...defaults.exceptions.specials, ...specials],\n shift: {\n ...shift,\n 1: [...defaults.exceptions.shift[1], ...shift[1]]\n }\n }\n };\n};\n// ----------------------------------------------------------------------\nFormatter.prototype.indent = function indent(options) {\n var tokens = tokenize(this.__code__, true);\n return this._indent(tokens, options);\n};\n// ----------------------------------------------------------------------\nFormatter.exception_shift = function(token, settings) {\n function match(list) {\n if (!list.length) {\n return false;\n }\n if (list.indexOf(token) !== -1) {\n return true;\n } else {\n var regexes = list.filter(s => s instanceof RegExp);\n if (!regexes.length) {\n return false;\n }\n for (let re of regexes) {\n if (token.match(re)) {\n return true;\n }\n }\n }\n return false;\n }\n if (match(settings.exceptions.specials)) {\n return settings.indent;\n }\n var shift = settings.exceptions.shift;\n for (var [indent, tokens] of Object.entries(shift)) {\n if (match(tokens)) {\n return +indent;\n }\n }\n return -1;\n};\n// ----------------------------------------------------------------------\nFormatter.prototype._indent = function _indent(tokens, options) {\n var settings = this._options(options);\n var spaces = lineIndent(tokens);\n var sexp = previousSexp(tokens);\n // one character before S-Expression\n var before_sexpr = tokens[tokens.length - sexp.length - 1];\n var last = tokens[tokens.length - 1];\n if (last.token.match(/^\"[\\S\\s]+[^\"]$/)) {\n return spaces + settings.indent;\n }\n if (sexp && sexp.length) {\n if (sexp[0].line > 0) {\n settings.offset = 0;\n }\n if (sexp.toString() === tokens.toString() && balanced(sexp)) {\n return settings.offset + sexp[0].col;\n } else if (sexp.length === 1) {\n return settings.offset + sexp[0].col + 1;\n } else {\n // search for token before S-Expression for case like #(10 or &(:x\n var exeption = -1;\n if (before_sexpr) {\n var shift = Formatter.exception_shift(before_sexpr.token, settings);\n if (shift !== -1) {\n exeption = shift;\n }\n }\n if (exeption === -1) {\n exeption = Formatter.exception_shift(sexp[1].token, settings);\n }\n if (exeption !== -1) {\n return settings.offset + sexp[0].col + exeption;\n } else if (sexp[0].line < sexp[1].line) {\n return settings.offset + sexp[0].col + 1;\n } else if (sexp.length > 3 && sexp[1].line === sexp[3].line) {\n if (sexp[1].token === '(' || sexp[1].token === '[') {\n return settings.offset + sexp[1].col;\n }\n return settings.offset + sexp[3].col;\n } else if (sexp[0].line === sexp[1].line) {\n return settings.offset + settings.indent + sexp[0].col;\n } else {\n var next_tokens = sexp.slice(2);\n for (var i = 0; i < next_tokens.length; ++i) {\n var token = next_tokens[i];\n if (token.token.trim()) {\n return token.col;\n }\n }\n }\n }\n } else {\n return 0;\n }\n return spaces + settings.indent;\n};\n// ----------------------------------------------------------------------\nfunction Ahead(pattern) {\n this.pattern = pattern;\n}\n// TODO: make it print\nAhead.prototype.toString = function() {\n return `#`;\n};\n// ----------------------------------------------------------------------\nAhead.prototype.match = function(string) {\n return string.match(this.pattern);\n};\n// ----------------------------------------------------------------------\n// Pattern have any number of patterns that is match using OR operator\n// pattern is in form of array with regular expressions\n// ----------------------------------------------------------------------\nfunction Pattern(...args) {\n var flag = args.pop();\n this.patterns = args;\n this.flag = flag;\n}\nPattern.prototype.toString = function() {\n var patterns = this.patterns.map(x => toString(x)).join('|');\n return `#`;\n};\n// ----------------------------------------------------------------------\nFormatter.Pattern = Pattern;\nFormatter.Ahead = Ahead;\nvar p_o = /^[[(]$/;\nvar p_e = /^[\\])]$/;\nvar not_p = /[^()[\\]]/;\nconst not_close = new Ahead(/[^)\\]]/);\n//const open = new Ahead(/[([]/);\nconst glob = Symbol.for('*');\nconst sexp_or_atom = new Pattern([p_o, glob, p_e], [not_p], '+');\nconst sexp = new Pattern([p_o, glob, p_e], '+');\nconst symbol = new Pattern([Symbol.for('symbol')], '?');\nconst symbols = new Pattern([Symbol.for('symbol')], '*');\nconst identifiers = [p_o, symbols, p_e];\nconst let_value = new Pattern([p_o, Symbol.for('symbol'), glob, p_e], '+');\n// rules for breaking S-Expressions into lines\nvar def_lambda_re = keywords_re('define', 'lambda', 'define-macro', 'syntax-rules');\n/* eslint-disable max-len */\nvar non_def = /^(?!.*\\b(?:[()[\\]]|define(?:-macro)?|let(?:\\*|rec|-env|-syntax|)?|lambda|syntax-rules)\\b).*$/;\n/* eslint-enable */\nvar let_re = /^(?:#:)?(let(?:\\*|rec|-env|-syntax)?)$/;\n// match keyword if it's normal token or gensym (prefixed with #:)\nfunction keywords_re(...args) {\n return new RegExp(`^(?:#:)?(?:${args.join('|')})$`);\n}\n// line breaking rules\nFormatter.rules = [\n [[sexp], 0, not_close],\n [[p_o, keywords_re('begin', 'cond-expand')], 1],\n [[p_o, let_re, symbol, p_o, let_value, p_e], 1],\n [[p_o, let_re, symbol, sexp_or_atom], 1, not_close],\n [[p_o, let_re, p_o, let_value], 1, not_close],\n //--[[p_o, keywords_re('define-syntax'), /.+/], 1],\n [[p_o, non_def, new Pattern([/[^()[\\]]/], '+'), sexp], 1, not_close],\n [[p_o, sexp], 1, not_close],\n [[p_o, not_p, sexp], 1, not_close],\n [[p_o, keywords_re('lambda', 'if'), not_p], 1, not_close],\n [[p_o, keywords_re('while'), not_p, sexp], 1, not_close],\n [[p_o, keywords_re('if'), not_p, glob], 1],\n [[p_o, def_lambda_re, identifiers], 0, not_close],\n [[p_o, def_lambda_re, identifiers, string_re], 0, not_close],\n [[p_o, def_lambda_re, identifiers, string_re, sexp], 0, not_close],\n [[p_o, def_lambda_re, identifiers, sexp], 0, not_close]\n];\n// ----------------------------------------------------------------------\nFormatter.prototype.break = function() {\n var code = this.__code__.replace(/\\n[ \\t]*/g, '\\n ').replace(/^\\s+/, '');\n // function that work when calling tokenize with meta data or not\n const token = t => {\n if (t.token.match(string_re) || t.token.match(re_re)) {\n return t.token;\n } else {\n return t.token.replace(/\\s+/, ' ');\n }\n };\n const first_token_index = tokens => {\n for (let i = tokens.length; i--;) {\n const token = tokens[i];\n if (token.trim() && !is_special(token)) {\n return tokens.length - i - 1;\n }\n }\n };\n // tokenize is part of the parser/lexer that split code into tokens and include\n // meta data like number of column or line\n var tokens = tokenize(code, true).map(token).filter(t => t !== '\\n');\n const { rules } = Formatter;\n outer: for (let i = 1; i < tokens.length; ++i) {\n if (!tokens[i].trim()) {\n continue;\n }\n var sub = tokens.slice(0, i);\n var sexp = {};\n rules.map(b => b[1]).forEach(count => {\n count = count.valueOf();\n // some patterns require to check what was before like\n // if inside let binding\n if (count > 0 && !sexp[count]) {\n sexp[count] = previousSexp(sub, count);\n }\n });\n for (let [pattern, count, ext] of rules) {\n count = count.valueOf();\n // 0 count mean ignore the previous S-Expression\n var test_sexp = count > 0 ? sexp[count] : sub;\n const input = test_sexp.filter(t => t.trim() && !is_special(t));\n const inc = first_token_index(test_sexp);\n var m = match(pattern, input);\n var next = tokens.slice(i).find(t => t.trim() && !is_special(t));\n if (m && (ext instanceof Ahead && ext.match(next) || !ext)) {\n const index = i - inc;\n if (tokens[index] !== '\\n') {\n if (!tokens[index].trim()) {\n tokens[index] = '\\n';\n } else {\n tokens.splice(index, 0, '\\n');\n i++;\n }\n }\n i += inc;\n continue outer;\n }\n }\n }\n this.__code__ = tokens.join('');\n return this;\n};\n// ----------------------------------------------------------------------\nFormatter.prototype._spaces = function(i) {\n return new Array(i + 1).join(' ');\n};\n// ----------------------------------------------------------------------\n// :: auto formatting of code, it require to have newlines\n// ----------------------------------------------------------------------\nFormatter.prototype.format = function format(options) {\n // prepare code with single space after newline\n // so we have space token to align\n var code = this.__code__.replace(/[ \\t]*\\n[ \\t]*/g, '\\n ');\n var tokens = tokenize(code, true);\n var settings = this._options(options);\n var indent = 0;\n var offset = 0;\n for (var i = 0; i < tokens.length; ++i) {\n var token = tokens[i];\n if (token.token === '\\n') {\n indent = this._indent(tokens.slice(0, i), settings);\n offset += indent;\n if (tokens[i + 1]) {\n tokens[i + 1].token = this._spaces(indent);\n // because we have single space as initial indent\n indent--;\n offset--;\n for (var j = i + 2; j < tokens.length; ++j) {\n tokens[j].offset += offset;\n tokens[j].col += indent;\n if (tokens[j].token === '\\n') {\n // ++i is called after the loop\n i = j - 1;\n break;\n }\n }\n }\n }\n }\n return tokens.map(token => {\n if (token.token.match(string_re)) {\n if (token.token.match(/\\n/)) {\n var spaces = new Array(token.col + 1).join(' ');\n var lines = token.token.split('\\n');\n token.token = [lines[0]].concat(lines.slice(1).map(line => {\n return spaces + line;\n })).join('\\n');\n }\n }\n return token.token;\n }).join('');\n};\n// ----------------------------------------------------------------------\n// :: flatten nested arrays\n// :: ref: https://stackoverflow.com/a/27282907/387194\n// ----------------------------------------------------------------------\nfunction flatten(array, mutable) {\n var toString = Object.prototype.toString;\n var arrayTypeStr = '[object Array]';\n\n var result = [];\n var nodes = (mutable && array) || array.slice();\n var node;\n\n if (!array.length) {\n return result;\n }\n\n node = nodes.pop();\n\n do {\n if (toString.call(node) === arrayTypeStr) {\n nodes.push.apply(nodes, node);\n } else {\n result.push(node);\n }\n } while (nodes.length && (node = nodes.pop()) !== undefined);\n\n result.reverse(); // we reverse result to restore the original order\n return result;\n}\n// ----------------------------------------------------------------------\n// :: Nil constructor with only once instance\n// ----------------------------------------------------------------------\nfunction Nil() {}\nNil.prototype.toString = function() {\n return '()';\n};\nNil.prototype.valueOf = function() {\n return undefined;\n};\nNil.prototype.serialize = function() {\n return 0;\n};\nNil.prototype.to_object = function() {\n return {};\n};\nNil.prototype.append = function(x) {\n return new Pair(x, nil);\n};\nNil.prototype.to_array = function() {\n return [];\n};\nvar nil = new Nil();\n// ----------------------------------------------------------------------\n// :: Pair constructor\n// ----------------------------------------------------------------------\nfunction Pair(car, cdr) {\n if (typeof this !== 'undefined' && this.constructor !== Pair ||\n typeof this === 'undefined') {\n return new Pair(car, cdr);\n }\n this.car = car;\n this.cdr = cdr;\n}\n// ----------------------------------------------------------------------\nfunction to_array(name, deep) {\n return function recur(list) {\n typecheck(name, list, ['pair', 'nil']);\n if (list === nil) {\n return [];\n }\n var result = [];\n var node = list;\n while (true) {\n if (node instanceof Pair) {\n if (node.haveCycles('cdr')) {\n break;\n }\n var car = node.car;\n if (deep && car instanceof Pair) {\n car = this.get(name).call(this, car);\n }\n result.push(car);\n node = node.cdr;\n } else if (node === nil) {\n break;\n } else {\n throw new Error(`${name}: can't convert improper list`);\n }\n }\n return result;\n };\n}\n// ----------------------------------------------------------------------\nPair.prototype.flatten = function() {\n return Pair.fromArray(flatten(this.to_array()));\n};\n// ----------------------------------------------------------------------\nPair.prototype.length = function() {\n var len = 0;\n var node = this;\n while (true) {\n if (!node || node === nil || !(node instanceof Pair) ||\n node.haveCycles('cdr')) {\n break;\n }\n len++;\n node = node.cdr;\n }\n return len;\n};\n// ----------------------------------------------------------------------\nPair.match = function(obj, item) {\n if (obj instanceof LSymbol) {\n return LSymbol.is(obj, item);\n } else if (obj instanceof Pair) {\n return Pair.match(obj.car, item) || Pair.match(obj.cdr, item);\n } else if (Array.isArray(obj)) {\n return obj.some(x => {\n return Pair.match(x, item);\n });\n } else if (is_plain_object(obj)) {\n return Object.values(obj).some(x => {\n return Pair.match(x, item);\n });\n }\n return false;\n};\n// ----------------------------------------------------------------------\nPair.prototype.find = function(item) {\n return Pair.match(this, item);\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.clone = function(deep = true) {\n var visited = new Map();\n function clone(node) {\n if (node instanceof Pair) {\n if (visited.has(node)) {\n return visited.get(node);\n }\n var pair = new Pair();\n visited.set(node, pair);\n if (deep) {\n pair.car = clone(node.car);\n } else {\n pair.car = node.car;\n }\n pair.cdr = clone(node.cdr);\n pair[__cycles__] = node[__cycles__];\n return pair;\n }\n return node;\n }\n return clone(this);\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.last_pair = function() {\n let node = this;\n while (true) {\n if (node.cdr === nil) {\n return node;\n }\n node = node.cdr;\n }\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.to_array = function(deep = true) {\n var result = [];\n if (this.car instanceof Pair) {\n if (deep) {\n result.push(this.car.to_array());\n } else {\n result.push(this.car);\n }\n } else {\n result.push(this.car.valueOf());\n }\n if (this.cdr instanceof Pair) {\n result = result.concat(this.cdr.to_array());\n }\n return result;\n};\n\n// ----------------------------------------------------------------------\nPair.fromArray = function(array, deep = true, quote = false) {\n if (array instanceof Pair || quote && array instanceof Array && array[__data__]) {\n return array;\n }\n if (deep === false) {\n var list = nil;\n for (let i = array.length; i--;) {\n list = new Pair(array[i], list);\n }\n return list;\n }\n if (array.length && !(array instanceof Array)) {\n array = [...array];\n }\n var result = nil;\n var i = array.length;\n while (i--) {\n let car = array[i];\n if (car instanceof Array) {\n car = Pair.fromArray(car, deep, quote);\n } else if (typeof car === 'string') {\n car = LString(car);\n } else if (typeof car === 'number' && !Number.isNaN(car)) {\n car = LNumber(car);\n }\n result = new Pair(car, result);\n }\n return result;\n};\n\n// ----------------------------------------------------------------------\n// by default to_object was created to create JavaScript objects,\n// so it use valueOf to get native values\n// literal parameter was a hack to allow create LComplex from LIPS code\n// ----------------------------------------------------------------------\nPair.prototype.to_object = function(literal = false) {\n var node = this;\n var result = {};\n while (true) {\n if (node instanceof Pair && node.car instanceof Pair) {\n var pair = node.car;\n var name = pair.car;\n if (name instanceof LSymbol) {\n name = name.__name__;\n }\n if (name instanceof LString) {\n name = name.valueOf();\n }\n var cdr = pair.cdr;\n if (cdr instanceof Pair) {\n cdr = cdr.to_object(literal);\n }\n if (is_native(cdr)) {\n if (!literal) {\n cdr = cdr.valueOf();\n }\n }\n result[name] = cdr;\n node = node.cdr;\n } else {\n break;\n }\n }\n return result;\n};\n\n// ----------------------------------------------------------------------\nPair.fromPairs = function(array) {\n return array.reduce((list, pair) => {\n return new Pair(\n new Pair(\n new LSymbol(pair[0]),\n pair[1]\n ),\n list\n );\n }, nil);\n};\n\n// ----------------------------------------------------------------------\nPair.fromObject = function(obj) {\n var array = Object.keys(obj).map((key) => [key, obj[key]]);\n return Pair.fromPairs(array);\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.reduce = function(fn) {\n var node = this;\n var result = nil;\n while (true) {\n if (node !== nil) {\n result = fn(result, node.car);\n node = node.cdr;\n } else {\n break;\n }\n }\n return result;\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.reverse = function() {\n if (this.haveCycles()) {\n throw new Error(\"You can't reverse list that have cycles\");\n }\n var node = this;\n var prev = nil;\n while (node !== nil) {\n var next = node.cdr;\n node.cdr = prev;\n prev = node;\n node = next;\n }\n return prev;\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.transform = function(fn) {\n var visited = [];\n function recur(pair) {\n if (pair instanceof Pair) {\n if (pair.replace) {\n delete pair.replace;\n return pair;\n }\n var car = fn(pair.car);\n if (car instanceof Pair) {\n car = recur(car);\n visited.push(car);\n }\n var cdr = fn(pair.cdr);\n if (cdr instanceof Pair) {\n cdr = recur(cdr);\n visited.push(cdr);\n }\n return new Pair(car, cdr);\n }\n return pair;\n }\n return recur(this);\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.map = function(fn) {\n if (typeof this.car !== 'undefined') {\n return new Pair(fn(this.car), this.cdr === nil ? nil : this.cdr.map(fn));\n } else {\n return nil;\n }\n};\nvar repr = new Map();\n// ----------------------------------------------------------------------\nfunction is_plain_object(object) {\n return object && typeof object === 'object' && object.constructor === Object;\n}\n// ----------------------------------------------------------------------\nvar props = Object.getOwnPropertyNames(Array.prototype);\nvar array_methods = [];\nprops.forEach(x => {\n array_methods.push(Array[x], Array.prototype[x]);\n});\n// ----------------------------------------------------------------------\nfunction is_array_method(x) {\n x = unbind(x);\n return array_methods.includes(x);\n}\n// ----------------------------------------------------------------------\nfunction is_lips_function(x) {\n return is_function(x) && (is_lambda(x) || x.__doc__);\n}\n// ----------------------------------------------------------------------\nfunction user_repr(obj) {\n var constructor = obj.constructor || Object;\n var plain_object = is_plain_object(obj);\n var iterator = is_function(obj[Symbol.asyncIterator]) ||\n is_function(obj[Symbol.iterator]);\n var fn;\n if (repr.has(constructor)) {\n fn = repr.get(constructor);\n } else {\n repr.forEach(function(value, key) {\n key = unbind(key);\n // if key is Object it should only work for plain_object\n // because otherwise it will match every object\n // we don't use instanceof so it don't work for subclasses\n if (obj.constructor === key &&\n (key === Object && plain_object && !iterator || key !== Object)) {\n fn = value;\n }\n });\n }\n return fn;\n}\n// ----------------------------------------------------------------------\nvar str_mapping = new Map();\n[\n [true, '#t'],\n [false, '#f'],\n [null, 'null'],\n [undefined, '#']\n].forEach(([key, value]) => {\n str_mapping.set(key, value);\n});\n// ----------------------------------------------------------------------\n// :: debug function that can be used with JSON.stringify\n// :: that will show symbols\n// ----------------------------------------------------------------------\n/* istanbul ignore next */\nfunction symbolize(obj) {\n if (obj && typeof obj === 'object') {\n var result = {};\n const symbols = Object.getOwnPropertySymbols(obj);\n symbols.forEach((key) => {\n const name = key.toString()\n .replace(/Symbol\\(([^)]+)\\)/, '$1');\n result[name] = toString(obj[key]);\n });\n const props = Object.getOwnPropertyNames(obj);\n props.forEach(key => {\n const o = obj[key];\n if (o && typeof o === 'object' && o.constructor === Object) {\n result[key] = symbolize(o);\n } else {\n result[key] = toString(o);\n }\n });\n return result;\n }\n return obj;\n}\n// ----------------------------------------------------------------------\nfunction get_props(obj) {\n return Object.keys(obj).concat(Object.getOwnPropertySymbols(obj));\n}\n// ----------------------------------------------------------------------\nfunction has_own_function(obj, name) {\n return obj.hasOwnProperty(name) && is_function(obj.toString);\n}\n// ----------------------------------------------------------------------\nfunction function_to_string(fn) {\n if (is_native_function(fn)) {\n return '#';\n }\n const constructor = fn.prototype && fn.prototype.constructor;\n if (is_function(constructor) && is_lambda(constructor)) {\n if (fn[__class__] && constructor.hasOwnProperty('__name__')) {\n let name = constructor.__name__;\n if (LString.isString(name)) {\n name = name.toString();\n return `#`;\n }\n return '#';\n }\n }\n if (fn.hasOwnProperty('__name__')) {\n let name = fn.__name__;\n if (typeof name === 'symbol') {\n name = symbol_to_string(name);\n }\n if (typeof name === 'string') {\n return `#`;\n }\n }\n if (has_own_function(fn, 'toString')) {\n return fn.toString();\n } else if (fn.name && !is_lambda(fn)) {\n return `#`;\n } else {\n return '#';\n }\n}\n// ----------------------------------------------------------------------\n// instances extracted to make cyclomatic complexity of toString smaller\nconst instances = new Map();\n// ----------------------------------------------------------------------\n[\n [Error, function(e) {\n return e.message;\n }],\n [Pair, function(pair, { quote, skip_cycles, pair_args }) {\n // make sure that repr directly after update set the cycle ref\n if (!skip_cycles) {\n pair.markCycles();\n }\n return pair.toString(quote, ...pair_args);\n }],\n [LCharacter, function(chr, { quote }) {\n if (quote) {\n return chr.toString();\n }\n return chr.valueOf();\n }],\n [LString, function(str, { quote }) {\n str = str.toString();\n if (quote) {\n return JSON.stringify(str).replace(/\\\\n/g, '\\n');\n }\n return str;\n }],\n [RegExp, function(re) {\n return '#' + re.toString();\n }]\n].forEach(([cls, fn]) => {\n instances.set(cls, fn);\n});\n// ----------------------------------------------------------------------\nconst native_types = [\n LSymbol,\n LNumber,\n Macro,\n Values,\n InputPort,\n OutputPort,\n Environment,\n QuotedPromise\n];\n// ----------------------------------------------------------------------\nfunction toString(obj, quote, skip_cycles, ...pair_args) {\n if (typeof jQuery !== 'undefined' &&\n obj instanceof jQuery.fn.init) {\n return '#';\n }\n if (str_mapping.has(obj)) {\n return str_mapping.get(obj);\n }\n if (is_prototype(obj)) {\n return '#';\n }\n if (obj) {\n var cls = obj.constructor;\n if (instances.has(cls)) {\n return instances.get(cls)(obj, { quote, skip_cycles, pair_args });\n }\n }\n // standard objects that have toString\n for (let type of native_types) {\n if (obj instanceof type) {\n return obj.toString(quote);\n }\n }\n // constants\n if ([nil, eof].includes(obj)) {\n return obj.toString();\n }\n if (is_function(obj)) {\n return function_to_string(obj);\n }\n if (obj === root) {\n return '#';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'object') {\n var constructor = obj.constructor;\n if (!constructor) {\n // this is case of fs.constants in Node.js that is null constructor object\n // this object can be handled like normal object that have properties\n constructor = Object;\n }\n var name;\n if (typeof constructor.__class__ === 'string') {\n name = constructor.__class__;\n } else {\n var fn = user_repr(obj);\n if (fn) {\n if (is_function(fn)) {\n return fn(obj, quote);\n } else {\n throw new Error('toString: Invalid repr value');\n }\n }\n name = constructor.name;\n }\n // user defined representation\n if (is_function(obj.toString) && is_lambda(obj.toString)) {\n return obj.toString().valueOf();\n }\n if (type(obj) === 'instance') {\n if (is_lambda(constructor) && constructor.__name__) {\n name = constructor.__name__.valueOf();\n } else if (!is_native_function(constructor)) {\n name = 'instance';\n }\n }\n if (is_iterator(obj, Symbol.iterator)) {\n if (name) {\n return `#`;\n }\n return '#';\n }\n if (is_iterator(obj, Symbol.asyncIterator)) {\n if (name) {\n return `#`;\n }\n return '#';\n }\n if (name !== '') {\n return '#<' + name + '>';\n }\n return '#';\n }\n if (typeof obj !== 'string') {\n return obj.toString();\n }\n return obj;\n}\n// ----------------------------------------------------------------------------\nfunction is_prototype(obj) {\n return obj &&\n typeof obj === 'object' &&\n obj.hasOwnProperty &&\n obj.hasOwnProperty(\"constructor\") &&\n typeof obj.constructor === \"function\" &&\n obj.constructor.prototype === obj;\n}\n// ----------------------------------------------------------------------------\nPair.prototype.markCycles = function() {\n markCycles(this);\n return this;\n};\n\n// ----------------------------------------------------------------------------\nPair.prototype.haveCycles = function(name = null) {\n if (!name) {\n return this.haveCycles('car') || this.haveCycles('cdr');\n }\n return !!(this[__cycles__] && this[__cycles__][name]);\n};\n\n// ----------------------------------------------------------------------------\nfunction markCycles(pair) {\n var seen_pairs = [];\n var cycles = [];\n var refs = [];\n function visit(pair) {\n if (!seen_pairs.includes(pair)) {\n seen_pairs.push(pair);\n }\n }\n function set(node, type, child, parents) {\n if (child instanceof Pair) {\n if (parents.includes(child)) {\n if (!refs.includes(child)) {\n refs.push(child);\n }\n if (!node[__cycles__]) {\n node[__cycles__] = {};\n }\n node[__cycles__][type] = child;\n if (!cycles.includes(node)) {\n cycles.push(node);\n }\n return true;\n }\n }\n }\n const detect = trampoline(function detect_thunk(pair, parents) {\n if (pair instanceof Pair) {\n delete pair.ref;\n delete pair[__cycles__];\n visit(pair);\n parents.push(pair);\n var car = set(pair, 'car', pair.car, parents);\n var cdr = set(pair, 'cdr', pair.cdr, parents);\n if (!car) {\n detect(pair.car, parents.slice());\n }\n if (!cdr) {\n return new Thunk(() => {\n return detect_thunk(pair.cdr, parents.slice());\n });\n }\n }\n });\n function mark_node(node, type) {\n if (node[__cycles__][type] instanceof Pair) {\n const count = ref_nodes.indexOf(node[__cycles__][type]);\n node[__cycles__][type] = `#${count}#`;\n }\n }\n detect(pair, []);\n var ref_nodes = seen_pairs.filter(node => refs.includes(node));\n ref_nodes.forEach((node, i) => {\n node[__ref__] = `#${i}=`;\n });\n cycles.forEach(node => {\n mark_node(node, 'car');\n mark_node(node, 'cdr');\n });\n}\n\n// ----------------------------------------------------------------------\n// trampoline based recursive pair to string that don't overflow the stack\n// ----------------------------------------------------------------------\n/* eslint-disable no-unused-vars */\n/* istanbul ignore next */\nconst pair_to_string = (function() {\n const prefix = (pair, nested) => {\n var result = [];\n if (pair[__ref__]) {\n result.push(pair[__ref__] + '(');\n } else if (!nested) {\n result.push('(');\n }\n return result;\n };\n const postfix = (pair, nested) => {\n if (!nested || pair[__ref__]) {\n return [')'];\n }\n return [];\n };\n return trampoline(function pairToString(pair, quote, extra = {}) {\n const {\n nested = false,\n result = [],\n cont = () => {\n result.push(...postfix(pair, nested));\n }\n } = extra;\n result.push(...prefix(pair, nested));\n let car;\n if (pair[__cycles__] && pair[__cycles__].car) {\n car = pair[__cycles__].car;\n } else {\n car = toString(pair.car, quote, true, { result, cont });\n }\n if (car !== undefined) {\n result.push(car);\n }\n return new Thunk(() => {\n if (pair.cdr instanceof Pair) {\n if (pair[__cycles__] && pair[__cycles__].cdr) {\n result.push(' . ');\n result.push(pair[__cycles__].cdr);\n } else {\n if (pair.cdr[__ref__]) {\n result.push(' . ');\n } else {\n result.push(' ');\n }\n return pairToString(pair.cdr, quote, {\n nested: true,\n result,\n cont\n });\n }\n } else if (pair.cdr !== nil) {\n result.push(' . ');\n result.push(toString(pair.cdr, quote));\n }\n }, cont);\n });\n})();\n\n// ----------------------------------------------------------------------\nPair.prototype.toString = function(quote, { nested = false } = {}) {\n var arr = [];\n if (this[__ref__]) {\n arr.push(this[__ref__] + '(');\n } else if (!nested) {\n arr.push('(');\n }\n var value;\n if (this[__cycles__] && this[__cycles__].car) {\n value = this[__cycles__].car;\n } else {\n value = toString(this.car, quote, true);\n }\n if (value !== undefined) {\n arr.push(value);\n }\n if (this.cdr instanceof Pair) {\n if (this[__cycles__] && this[__cycles__].cdr) {\n arr.push(' . ');\n arr.push(this[__cycles__].cdr);\n } else {\n if (this.cdr[__ref__]) {\n arr.push(' . ');\n } else {\n arr.push(' ');\n }\n const cdr = this.cdr.toString(quote, { nested: true });\n arr.push(cdr);\n }\n } else if (this.cdr !== nil) {\n arr = arr.concat([' . ', toString(this.cdr, quote, true)]);\n }\n if (!nested || this[__ref__]) {\n arr.push(')');\n }\n return arr.join('');\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.set = function(prop, value) {\n this[prop] = value;\n if (value instanceof Pair) {\n this.markCycles();\n }\n};\n\n// ----------------------------------------------------------------------\nPair.prototype.append = function(arg) {\n if (arg instanceof Array) {\n return this.append(Pair.fromArray(arg));\n }\n var p = this;\n if (p.car === undefined) {\n if (arg instanceof Pair) {\n this.car = arg.car;\n this.cdr = arg.cdr;\n } else {\n this.car = arg;\n }\n } else if (arg !== nil) {\n while (true) {\n if (p instanceof Pair && p.cdr !== nil) {\n p = p.cdr;\n } else {\n break;\n }\n }\n p.cdr = arg;\n }\n return this;\n};\n// ----------------------------------------------------------------------\nPair.prototype.serialize = function() {\n return [\n this.car,\n this.cdr\n ];\n};\n// ----------------------------------------------------------------------\n// :: List iterator (for do-iterator macro)\n// ----------------------------------------------------------------------\nPair.prototype[Symbol.iterator] = function() {\n var node = this;\n return {\n next: function() {\n var cur = node;\n node = cur.cdr;\n if (cur === nil) {\n return { value: undefined, done: true };\n } else {\n return { value: cur.car, done: false };\n }\n }\n };\n};\n// ----------------------------------------------------------------------\n// :: abs that work on BigInt\n// ----------------------------------------------------------------------\nfunction abs(x) {\n return x < 0 ? -x : x;\n}\n// ----------------------------------------------------------------------\nfunction seq_compare(fn, args) {\n var [a, ...rest] = args;\n while (rest.length > 0) {\n var [b] = rest;\n if (!fn(a, b)) {\n return false;\n }\n [a, ...rest] = rest;\n }\n return true;\n}\n\n// ----------------------------------------------------------------------\nfunction equal(x, y) {\n if (is_function(x)) {\n return is_function(y) && unbind(x) === unbind(y);\n } else if (x instanceof LNumber) {\n if (!(y instanceof LNumber)) {\n return false;\n }\n let type;\n if (x.__type__ === y.__type__) {\n if (x.__type__ === 'complex') {\n type = x.__im__.__type__ === y.__im__.__type__ &&\n x.__re__.__type__ === y.__re__.__type__;\n } else {\n type = true;\n }\n if (type && x.cmp(y) === 0) {\n if (x.valueOf() === 0) {\n return Object.is(x.valueOf(), y.valueOf());\n }\n return true;\n }\n }\n return false;\n } else if (typeof x === 'number') {\n if (typeof y !== 'number') {\n return false;\n }\n if (Number.isNaN(x)) {\n return Number.isNaN(y);\n }\n if (x === Number.NEGATIVE_INFINITY) {\n return y === Number.NEGATIVE_INFINITY;\n }\n if (x === Number.POSITIVE_INFINITY) {\n return y === Number.POSITIVE_INFINITY;\n }\n return equal(LNumber(x), LNumber(y));\n } else if (x instanceof LCharacter) {\n if (!(y instanceof LCharacter)) {\n return false;\n }\n return x.__char__ === y.__char__;\n } else {\n return x === y;\n }\n}\n// ----------------------------------------------------------------------\nfunction same_atom(a, b) {\n if (type(a) !== type(b)) {\n return false;\n }\n if (!is_atom(a)) {\n return false;\n }\n if (a instanceof RegExp) {\n return a.source === b.source;\n }\n if (a instanceof LString) {\n return a.valueOf() === b.valueOf();\n }\n return equal(a, b);\n}\n// ----------------------------------------------------------------------\nfunction is_atom(obj) {\n return obj instanceof LSymbol ||\n LString.isString(obj) ||\n obj === nil ||\n obj === null ||\n obj instanceof LCharacter ||\n obj instanceof LNumber ||\n obj === true ||\n obj === false;\n}\n// ----------------------------------------------------------------------\nvar truncate = (function() {\n if (Math.trunc) {\n return Math.trunc;\n } else {\n return function(x) {\n if (x === 0) {\n return 0;\n } else if (x < 0) {\n return Math.ceil(x);\n } else {\n return Math.floor(x);\n }\n };\n }\n})();\n// ----------------------------------------------------------------------\n// :: Macro constructor\n// ----------------------------------------------------------------------\nfunction Macro(name, fn, doc, dump) {\n if (typeof this !== 'undefined' && this.constructor !== Macro ||\n typeof this === 'undefined') {\n return new Macro(name, fn);\n }\n typecheck('Macro', name, 'string', 1);\n typecheck('Macro', fn, 'function', 2);\n if (doc) {\n if (dump) {\n this.__doc__ = doc;\n } else {\n this.__doc__ = trim_lines(doc);\n }\n }\n this.__name__ = name;\n this.__fn__ = fn;\n}\n// ----------------------------------------------------------------------\nMacro.defmacro = function(name, fn, doc, dump) {\n var macro = new Macro(name, fn, doc, dump);\n macro.__defmacro__ = true;\n return macro;\n};\n// ----------------------------------------------------------------------\nMacro.prototype.invoke = function(code, { env, dynamic_scope, error }, macro_expand) {\n var args = {\n dynamic_scope,\n error,\n macro_expand\n };\n var result = this.__fn__.call(env, code, args, this.__name__);\n return result;\n //return macro_expand ? quote(result) : result;\n};\n// ----------------------------------------------------------------------\nMacro.prototype.toString = function() {\n return `#`;\n};\n// ----------------------------------------------------------------------\nconst macro = 'define-macro';\n// ----------------------------------------------------------------------\nconst recur_guard = -10000;\nfunction macro_expand(single) {\n return async function(code, args) {\n var env = args['env'] = this;\n var bindings = [];\n var let_macros = ['let', 'let*', 'letrec'];\n var lambda = global_env.get('lambda');\n var define = global_env.get('define');\n function is_let_macro(symbol) {\n var name = symbol.valueOf();\n return let_macros.includes(name);\n }\n function is_procedure(value, node) {\n return value === define && node.cdr.car instanceof Pair;\n }\n function is_lambda(value) {\n return value === lambda;\n }\n function proc_bindings(node) {\n var names = [];\n while (true) {\n if (node !== nil) {\n if (node instanceof LSymbol) {\n names.push(node.valueOf());\n break;\n }\n names.push(node.car.valueOf());\n node = node.cdr;\n } else {\n break;\n }\n }\n return [...bindings, ...names];\n }\n function let_binding(node) {\n return [...bindings, ...node.to_array(false).map(function(node) {\n if (node instanceof Pair) {\n return node.car.valueOf();\n }\n throw new Error('macroexpand: Invalid let binding');\n })];\n }\n function is_macro(name, value) {\n return value instanceof Macro &&\n value.__defmacro__ &&\n !bindings.includes(name);\n }\n async function expand_let_binding(node, n) {\n if (node === nil) {\n return nil;\n }\n var pair = node.car;\n return new Pair(\n new Pair(\n pair.car,\n await traverse(pair.cdr, n, env)\n ),\n await expand_let_binding(node.cdr)\n );\n }\n async function traverse(node, n, env) {\n if (node instanceof Pair && node.car instanceof LSymbol) {\n if (node[__data__]) {\n return node;\n }\n var name = node.car.valueOf();\n var value = env.get(node.car, { throwError: false });\n var is_let = is_let_macro(node.car);\n\n var is_binding = is_let ||\n is_procedure(value, node) ||\n is_lambda(value);\n\n if (is_binding && node.cdr.car instanceof Pair) {\n var second;\n if (is_let) {\n bindings = let_binding(node.cdr.car);\n second = await expand_let_binding(node.cdr.car, n);\n } else {\n bindings = proc_bindings(node.cdr.car);\n second = node.cdr.car;\n }\n return new Pair(\n node.car,\n new Pair(\n second,\n await traverse(node.cdr.cdr, n, env)\n )\n );\n } else if (is_macro(name, value)) {\n var code = value instanceof Syntax ? node : node.cdr;\n var result = await value.invoke(code, { ...args, env }, true);\n if (value instanceof Syntax) {\n const { expr, scope } = result;\n if (expr instanceof Pair) {\n if (n !== -1 && n <= 1 || n < recur_guard) {\n return expr;\n }\n if (n !== -1) {\n n = n - 1;\n }\n return traverse(expr, n, scope);\n }\n result = expr;\n }\n if (result instanceof LSymbol) {\n return quote(result);\n }\n if (result instanceof Pair) {\n if (n !== -1 && n <= 1 || n < recur_guard) {\n return result;\n }\n if (n !== -1) {\n n = n - 1;\n }\n return traverse(result, n, env);\n }\n if (is_atom(result)) {\n return result;\n }\n }\n }\n // TODO: CYCLE DETECT\n var car = node.car;\n if (car instanceof Pair) {\n car = await traverse(car, n, env);\n }\n var cdr = node.cdr;\n if (cdr instanceof Pair) {\n cdr = await traverse(cdr, n, env);\n }\n var pair = new Pair(car, cdr);\n return pair;\n }\n //var this.__code__ = code;\n if (code.cdr instanceof Pair && LNumber.isNumber(code.cdr.car)) {\n return quote((await traverse(code, code.cdr.car.valueOf(), env)).car);\n }\n if (single) {\n return quote((await traverse(code, 1, env)).car);\n }\n return quote((await traverse(code, -1, env)).car);\n };\n}\n// ----------------------------------------------------------------------\n// TODO: Don't put Syntax as Macro they are not runtime\n// ----------------------------------------------------------------------\nfunction Syntax(fn, env) {\n this.__env__ = env;\n this.__fn__ = fn;\n // allow macroexpand\n this.__defmacro__ = true;\n}\nSyntax.__merge_env__ = Symbol.for('merge');\n// ----------------------------------------------------------------------\nSyntax.prototype = Object.create(Macro.prototype);\nSyntax.prototype.invoke = function(code, { error, env }, macro_expand) {\n var args = {\n error,\n env,\n dynamic_scope: this.__env__,\n macro_expand\n };\n return this.__fn__.call(env, code, args, this.__name__ || 'syntax');\n};\nSyntax.prototype.constructor = Syntax;\nSyntax.prototype.toString = function() {\n if (this.__name__) {\n return `#`;\n }\n return '#';\n};\nSyntax.className = 'syntax';\n// ----------------------------------------------------------------------\n// :: TODO: SRFI-139\n// ----------------------------------------------------------------------\nclass Parameter extends Syntax {\n}\nSyntax.Parameter = Parameter;\n// ----------------------------------------------------------------------\n// :: for usage in syntax-rule when pattern match it will return\n// :: list of bindings from code that match the pattern\n// :: TODO detect cycles\n// ----------------------------------------------------------------------\nfunction extract_patterns(pattern, code, symbols, ellipsis_symbol, scope = {}) {\n var bindings = {\n '...': {\n symbols: { }, // symbols ellipsis (x ...)\n lists: [ ]\n },\n symbols: { }\n };\n const { expansion, define } = scope;\n // pattern_names parameter is used to distinguish\n // multiple matches of ((x ...) ...) agains ((1 2 3) (1 2 3))\n // in loop we add x to the list so we know that this is not\n // duplicated ellipsis symbol\n function log(x) {\n /* istanbul ignore next */\n if (is_debug()) {\n console.log(x);\n }\n }\n log(symbols);\n /* eslint-disable complexity */\n function traverse(pattern, code, pattern_names = [], ellipsis = false) {\n log({\n code: code && toString(code, true),\n pattern: pattern && toString(pattern, true)\n });\n if (is_atom(pattern) && !(pattern instanceof LSymbol)) {\n return same_atom(pattern, code);\n }\n if (pattern instanceof LSymbol &&\n symbols.includes(pattern.literal())) {\n const ref = expansion.ref(code);\n // shadowing the identifier works only with lambda and let\n if (LSymbol.is(code, pattern)) {\n if (typeof ref === 'undefined') {\n return true;\n }\n return ref === define || ref === global_env;\n }\n return false;\n }\n // pattern (a b (x ...)) and (x ...) match nil\n if (pattern instanceof Pair &&\n pattern.car instanceof Pair &&\n pattern.car.cdr instanceof Pair &&\n LSymbol.is(pattern.car.cdr.car, ellipsis_symbol)) {\n log('>> 0');\n if (code === nil) {\n log({ pattern: pattern.toString() });\n if (pattern.car.car instanceof LSymbol) {\n if (pattern.car.cdr instanceof Pair &&\n LSymbol.is(pattern.car.cdr.car, ellipsis_symbol)) {\n let name = pattern.car.car.valueOf();\n const last = pattern.last_pair();\n if (LSymbol.is(last.car, ellipsis_symbol)) {\n bindings['...'].symbols[name] = null;\n return true;\n } else {\n return false;\n }\n }\n let name = pattern.car.car.valueOf();\n if (bindings['...'].symbols[name]) {\n throw new Error('syntax: named ellipsis can only ' +\n 'appear onces');\n }\n bindings['...'].symbols[name] = code;\n }\n }\n }\n if (pattern instanceof Pair &&\n pattern.cdr instanceof Pair &&\n LSymbol.is(pattern.cdr.car, ellipsis_symbol)) {\n // pattern (... ???) - SRFI-46\n if (pattern.cdr.cdr !== nil) {\n if (pattern.cdr.cdr instanceof Pair) {\n // if we have (x ... a b) we need to remove two from the end\n const list_len = pattern.cdr.cdr.length();\n let code_len = code.length();\n let list = code;\n while (code_len - 1 > list_len) {\n list = list.cdr;\n code_len--;\n }\n const rest = list.cdr;\n list.cdr = nil;\n if (!traverse(pattern.cdr.cdr, rest, pattern_names, ellipsis)) {\n return false;\n }\n }\n }\n if (pattern.car instanceof LSymbol) {\n let name = pattern.car.__name__;\n if (bindings['...'].symbols[name] &&\n !pattern_names.includes(name) && !ellipsis) {\n throw new Error('syntax: named ellipsis can only appear onces');\n }\n log('>> 1');\n if (code === nil) {\n log('>> 2');\n if (ellipsis) {\n log('NIL');\n bindings['...'].symbols[name] = nil;\n } else {\n log('NULL');\n bindings['...'].symbols[name] = null;\n }\n } else if (code instanceof Pair &&\n (code.car instanceof Pair || code.car === nil)) {\n log('>> 3 ' + ellipsis);\n if (ellipsis) {\n if (bindings['...'].symbols[name]) {\n let node = bindings['...'].symbols[name];\n if (node === nil) {\n node = new Pair(nil, new Pair(code, nil));\n } else {\n node = node.append(new Pair(code, nil));\n }\n bindings['...'].symbols[name] = node;\n } else {\n bindings['...'].symbols[name] = new Pair(code, nil);\n }\n } else {\n log('>> 4');\n bindings['...'].symbols[name] = new Pair(code, nil);\n }\n } else {\n log('>> 6');\n if (code instanceof Pair) {\n log('>> 7 ' + ellipsis);\n pattern_names.push(name);\n if (!bindings['...'].symbols[name]) {\n bindings['...'].symbols[name] = new Pair(\n code,\n nil\n );\n } else {\n const node = bindings['...'].symbols[name];\n bindings['...'].symbols[name] = node.append(\n new Pair(\n code,\n nil\n )\n );\n }\n log({ IIIIII: bindings['...'].symbols[name].toString() });\n } else {\n log('>> 8');\n return false;\n //bindings['...'].symbols[name] = code;\n }\n }\n return true;\n } else if (pattern.car instanceof Pair) {\n var names = [...pattern_names];\n if (code === nil) {\n log('>> 9');\n bindings['...'].lists.push(nil);\n return true;\n }\n log('>> 10');\n let node = code;\n while (node instanceof Pair) {\n if (!traverse(pattern.car, node.car, names, true)) {\n return false;\n }\n node = node.cdr;\n }\n return true;\n }\n return false;\n }\n if (pattern instanceof LSymbol) {\n if (LSymbol.is(pattern, ellipsis_symbol)) {\n throw new Error('syntax: invalid usage of ellipsis');\n }\n log('>> 11');\n const name = pattern.__name__;\n if (symbols.includes(name)) {\n return true;\n }\n log({ name, ellipsis });\n if (ellipsis) {\n bindings['...'].symbols[name] = bindings['...'].symbols[name] || [];\n bindings['...'].symbols[name].push(code);\n }\n bindings.symbols[name] = code;\n if (!bindings.symbols[name]) {\n }\n return true;\n }\n if (pattern instanceof Pair && code instanceof Pair) {\n log('>> 12');\n log({\n a: 12,\n code: code && code.toString(),\n pattern: pattern.toString()\n });\n if (code.cdr === nil) {\n // last item in in call using in recursive calls on\n // last element of the list\n // case of pattern (p . rest) and code (0)\n var rest_pattern = pattern.car instanceof LSymbol &&\n pattern.cdr instanceof LSymbol;\n if (rest_pattern) {\n // fix for SRFI-26 in recursive call of (b) ==> (<> . x)\n // where <> is symbol\n if (!traverse(pattern.car, code.car, pattern_names, ellipsis)) {\n return false;\n }\n log('>> 12 | 1');\n let name = pattern.cdr.valueOf();\n if (!(name in bindings.symbols)) {\n bindings.symbols[name] = nil;\n }\n name = pattern.car.valueOf();\n if (!(name in bindings.symbols)) {\n bindings.symbols[name] = code.car;\n }\n return true;\n }\n }\n log({\n pattern: pattern.toString(),\n code: code.toString()\n });\n // case (x y) ===> (var0 var1 ... warn) where var1 match nil\n if (pattern.cdr instanceof Pair &&\n pattern.car instanceof LSymbol &&\n pattern.cdr.cdr instanceof Pair &&\n pattern.cdr.car instanceof LSymbol &&\n LSymbol.is(pattern.cdr.cdr.car, ellipsis_symbol) &&\n pattern.cdr.cdr.cdr instanceof Pair &&\n !LSymbol.is(pattern.cdr.cdr.cdr.car, ellipsis_symbol) &&\n traverse(pattern.car, code.car, pattern_names, ellipsis) &&\n traverse(pattern.cdr.cdr.cdr, code.cdr, pattern_names, ellipsis)) {\n const name = pattern.cdr.car.__name__;\n log({\n pattern: pattern.car.toString(),\n code: code.car.toString(),\n name\n });\n if (symbols.includes(name)) {\n return true;\n }\n bindings['...'].symbols[name] = null;\n return true;\n }\n log('recur');\n if (traverse(pattern.car, code.car, pattern_names, ellipsis) &&\n traverse(pattern.cdr, code.cdr, pattern_names, ellipsis)) {\n return true;\n }\n } else if (pattern === nil && (code === nil || code === undefined)) {\n // undefined is case when you don't have body ...\n // and you do recursive call\n return true;\n } else if (pattern.car instanceof Pair &&\n LSymbol.is(pattern.car.car, ellipsis_symbol)) {\n // pattern (...)\n throw new Error('syntax: invalid usage of ellipsis');\n } else {\n return false;\n }\n }\n /* eslint-enable complexity */\n if (traverse(pattern, code)) {\n return bindings;\n }\n}\n// ----------------------------------------------------------------------\n// :: This function is called after syntax-rules macro is evaluated\n// :: and if there are any gensyms added by macro they need to restored\n// :: to original symbols\n// ----------------------------------------------------------------------\nfunction clear_gensyms(node, gensyms) {\n function traverse(node) {\n if (node instanceof Pair) {\n if (!gensyms.length) {\n return node;\n }\n const car = traverse(node.car);\n const cdr = traverse(node.cdr);\n // TODO: check if it's safe to modify the list\n // some funky modify of code can happen in macro\n return new Pair(car, cdr);\n } else if (node instanceof LSymbol) {\n var replacement = gensyms.find((gensym) => {\n return gensym.gensym === node;\n });\n if (replacement) {\n return LSymbol(replacement.name);\n }\n return node;\n } else {\n return node;\n }\n }\n return traverse(node);\n}\n// ----------------------------------------------------------------------\nfunction transform_syntax(options = {}) {\n const {\n bindings,\n expr,\n scope,\n symbols,\n names,\n ellipsis: ellipsis_symbol } = options;\n var gensyms = {};\n function valid_symbol(symbol) {\n if (symbol instanceof LSymbol) {\n return true;\n }\n return ['string', 'symbol'].includes(typeof symbol);\n }\n function transform(symbol) {\n if (!valid_symbol(symbol)) {\n const t = type(symbol);\n throw new Error(`syntax: internal error, need symbol got ${t}`);\n }\n const name = symbol.valueOf();\n if (name === ellipsis_symbol) {\n throw new Error('syntax: internal error, ellipis not transformed');\n }\n // symbols are gensyms from nested syntax-rules\n var n_type = typeof name;\n if (['string', 'symbol'].includes(n_type)) {\n if (name in bindings.symbols) {\n return bindings.symbols[name];\n } else if (n_type === 'string' && name.match(/\\./)) {\n // calling method on pattern symbol #83\n const parts = name.split('.');\n const first = parts[0];\n if (first in bindings.symbols) {\n return Pair.fromArray([\n LSymbol('.'),\n bindings.symbols[first]\n ].concat(parts.slice(1).map(x => LString(x))));\n }\n }\n }\n if (symbols.includes(name)) {\n return LSymbol(name);\n }\n return rename(name);\n }\n function log(x) {\n /* istanbul ignore next */\n if (is_debug()) {\n console.log(x);\n }\n }\n function rename(name) {\n if (!gensyms[name]) {\n var ref = scope.ref(name);\n const gensym_name = gensym(name);\n if (ref) {\n const value = scope.get(name);\n scope.set(gensym_name, value);\n } else {\n const value = scope.get(name, { throwError: false });\n // value is not in scope, but it's JavaScript object\n if (typeof value !== 'undefined') {\n scope.set(gensym_name, value);\n }\n }\n // keep names so they can be restored after evaluation\n // if there are free symbols as output\n // kind of hack\n names.push({\n name, gensym: gensym_name\n });\n gensyms[name] = gensym_name;\n // we need to check if name is a string, because it can be\n // gensym from nested syntax-rules\n if (typeof name === 'string' && name.match(/\\./)) {\n const [first, ...rest] = name.split('.').filter(Boolean);\n // save JavaScript dot notation for Env::get\n if (gensyms[first]) {\n hidden_prop(gensym_name, '__object__', [gensyms[first], ...rest]);\n }\n }\n }\n return gensyms[name];\n }\n function transform_ellipsis_expr(expr, bindings, state, next = () => {}) {\n const { nested } = state;\n log(' ==> ' + expr.toString(true));\n log(bindings);\n if (expr instanceof LSymbol) {\n const name = expr.valueOf();\n log('[t 1');\n if (bindings[name]) {\n if (bindings[name] instanceof Pair) {\n const { car, cdr } = bindings[name];\n if (nested) {\n const { car: caar, cdr: cadr } = car;\n if (cadr !== nil) {\n next(name, new Pair(cadr, nil));\n }\n return caar;\n }\n if (cdr !== nil) {\n next(name, cdr);\n }\n return car;\n } else if (bindings[name] instanceof Array) {\n next(name, bindings[name].slice(1));\n return bindings[name][0];\n }\n }\n return transform(name);\n }\n if (expr instanceof Pair) {\n if (expr.car instanceof LSymbol &&\n expr.cdr instanceof Pair &&\n LSymbol.is(expr.cdr.car, ellipsis_symbol)) {\n log('[t 2');\n const name = expr.car.valueOf();\n const item = bindings[name];\n log({ expr: expr.toString(true), name, bindings, item });\n if (item === null) {\n return;\n } else if (item) {\n log({ b: bindings[name].toString() });\n if (item instanceof Pair) {\n log('[t 2 Pair ' + nested);\n log({ ______: item.toString() });\n const { car, cdr } = item;\n if (nested) {\n if (cdr !== nil) {\n log('|| next 1');\n next(name, cdr);\n }\n log({ car: car.toString() });\n return car;\n } else {\n if (car.cdr !== nil) {\n log('|| next 2');\n next(name, new Pair(car.cdr, cdr));\n }\n log({ car: car.car.toString() });\n return car.car;\n }\n } else if (item instanceof Array) {\n log('[t 2 Array ' + nested);\n if (nested) {\n next(name, item.slice(1));\n return Pair.fromArray(item);\n } else {\n const rest = item.slice(1);\n if (rest.length) {\n next(name, rest);\n }\n return item[0];\n }\n } else {\n return item;\n }\n }\n }\n log('[t 3 recur ' + expr.toString());\n const head = transform_ellipsis_expr(expr.car, bindings, state, next);\n const rest = transform_ellipsis_expr(expr.cdr, bindings, state, next);\n return new Pair(\n head,\n rest\n );\n }\n return expr;\n }\n function have_binding(biding, skip_nulls) {\n const values = Object.values(biding);\n const symbols = Object.getOwnPropertySymbols(biding);\n if (symbols.length) {\n values.push(...symbols.map(x => biding[x]));\n }\n return values.length && values.every(x => {\n if (x === null) {\n return !skip_nulls;\n }\n return x instanceof Pair || x === nil ||\n (x instanceof Array && x.length);\n });\n }\n function get_names(object) {\n return Object.keys(object).concat(Object.getOwnPropertySymbols(object));\n }\n /* eslint-disable complexity */\n function traverse(expr, { disabled } = {}) {\n log('traverse>> ' + expr.toString());\n if (expr instanceof Pair) {\n // escape ellispsis from R7RS e.g. (... ...)\n if (!disabled && expr.car instanceof Pair &&\n LSymbol.is(expr.car.car, ellipsis_symbol)) {\n return traverse(expr.car.cdr, { disabled: true });\n }\n if (expr.cdr instanceof Pair &&\n LSymbol.is(expr.cdr.car, ellipsis_symbol) && !disabled) {\n log('>> 1');\n const symbols = bindings['...'].symbols;\n // skip expand list of pattern was (x y ... z)\n // and code was (x z) so y == null\n const values = Object.values(symbols);\n if (values.length && values.every(x => x === null)) {\n return traverse(expr.cdr.cdr, { disabled });\n }\n var keys = get_names(symbols);\n // case of list as first argument ((x . y) ...) or (x ... ...)\n // we need to recursively process the list\n // if we have pattern (_ (x y z ...) ...) and code (foo (1 2) (1 2))\n // x an y will be arrays of [1 1] and [2 2] and z will be array\n // of rest, x will also have it's own mapping to 1 and y to 2\n // in case of usage outside of ellipsis list e.g.: (x y)\n var is_spread = expr.car instanceof LSymbol &&\n LSymbol.is(expr.cdr.cdr.car, ellipsis_symbol);\n if (expr.car instanceof Pair || is_spread) {\n // lists is free ellipsis on pairs ((???) ...)\n // TODO: will this work in every case? Do we need to handle\n // nesting here?\n if (bindings['...'].lists[0] === nil) {\n return nil;\n }\n var new_expr = expr.car;\n if (is_spread) {\n new_expr = new Pair(\n expr.car,\n new Pair(\n expr.cdr.car,\n nil));\n }\n log('>> 2');\n let result;\n if (keys.length) {\n log('>> 2 (a)');\n let bind = { ...symbols };\n result = nil;\n while (true) {\n if (!have_binding(bind)) {\n break;\n }\n const new_bind = {};\n const next = (key, value) => {\n // ellipsis decide it what should be the next value\n // there are two cases ((a . b) ...) and (a ...)\n new_bind[key] = value;\n };\n const car = transform_ellipsis_expr(\n new_expr,\n bind,\n { nested: true },\n next\n );\n // undefined can be null caused by null binding\n // on empty ellipsis\n if (car !== undefined) {\n if (is_spread) {\n if (result === nil) {\n result = car;\n } else {\n result = result.append(car);\n }\n } else {\n result = new Pair(\n car,\n result\n );\n }\n }\n bind = new_bind;\n }\n if (result !== nil && !is_spread) {\n result = result.reverse();\n }\n // case of (list) ... (rest code)\n if (expr.cdr.cdr !== nil &&\n !LSymbol.is(expr.cdr.cdr.car, ellipsis_symbol)) {\n const rest = traverse(expr.cdr.cdr, { disabled });\n return result.append(rest);\n }\n return result;\n } else {\n log('>> 3');\n const car = transform_ellipsis_expr(expr.car, symbols, {\n nested: true\n });\n if (car) {\n return new Pair(\n car,\n nil\n );\n }\n return nil;\n }\n } else if (expr.car instanceof LSymbol) {\n log('>> 4');\n if (LSymbol.is(expr.cdr.cdr.car, ellipsis_symbol)) {\n // case (x ... ...)\n log('>> 4 (a)');\n } else {\n log('>> 4 (b)');\n }\n // case: (x ...)\n let name = expr.car.__name__;\n let bind = { [name]: symbols[name] };\n const is_null = symbols[name] === null;\n let result = nil;\n while (true) {\n if (!have_binding(bind, true)) {\n log({ bind });\n break;\n }\n const new_bind = {};\n const next = (key, value) => {\n new_bind[key] = value;\n };\n const value = transform_ellipsis_expr(\n expr,\n bind,\n { nested: false },\n next\n );\n log({ value: value.toString() });\n if (typeof value !== 'undefined') {\n result = new Pair(\n value,\n result\n );\n }\n bind = new_bind;\n }\n if (result !== nil) {\n result = result.reverse();\n }\n // case if (x ... y ...) second spread is not processed\n // and (??? . x) last symbol\n // by ellipsis transformation\n if (expr.cdr instanceof Pair) {\n if (expr.cdr.cdr instanceof Pair ||\n expr.cdr.cdr instanceof LSymbol) {\n const node = traverse(expr.cdr.cdr, { disabled });\n if (is_null) {\n return node;\n }\n log('<<<< 1');\n result.append(node);\n }\n }\n log('<<<< 2');\n return result;\n }\n }\n const head = traverse(expr.car, { disabled });\n let rest;\n let is_syntax;\n if ((expr.car instanceof LSymbol)) {\n const value = scope.get(expr.car, { throwError: false });\n is_syntax = value instanceof Macro &&\n value.__name__ === 'syntax-rules';\n }\n if (is_syntax) {\n if (expr.cdr.car instanceof LSymbol) {\n rest = new Pair(\n traverse(expr.cdr.car, { disabled }),\n new Pair(\n expr.cdr.cdr.car,\n traverse(expr.cdr.cdr.cdr, { disabled })\n )\n );\n } else {\n rest = new Pair(\n expr.cdr.car,\n traverse(expr.cdr.cdr, { disabled })\n );\n }\n log('REST >>>> ' + rest.toString());\n } else {\n rest = traverse(expr.cdr, { disabled });\n }\n log({\n a: true,\n car: toString(expr.car),\n cdr: toString(expr.cdr),\n head: toString(head),\n rest: toString(rest)\n });\n return new Pair(\n head,\n rest\n );\n }\n if (expr instanceof LSymbol) {\n if (disabled && LSymbol.is(expr, ellipsis_symbol)) {\n return expr;\n }\n const symbols = Object.keys(bindings['...'].symbols);\n const name = expr.literal();\n if (symbols.includes(name)) {\n const msg = `missing ellipsis symbol next to name \\`${name}'`;\n throw new Error(`syntax-rules: ${msg}`);\n }\n const value = transform(expr, { disabled });\n if (typeof value !== 'undefined') {\n return value;\n }\n }\n return expr;\n }\n return traverse(expr, {});\n}\n// ----------------------------------------------------------------------\n// :: check for nullish values\n// ----------------------------------------------------------------------\nfunction is_null(value) {\n return is_undef(value) || value === nil || value === null;\n}\n// ----------------------------------------------------------------------\nfunction is_function(o) {\n return typeof o === 'function' && typeof o.bind === 'function';\n}\n// ----------------------------------------------------------------------\nfunction is_continuation(o) {\n return o instanceof Continuation;\n}\n// ----------------------------------------------------------------------\nfunction is_callable(o) {\n return is_function(o) || is_continuation(o);\n}\n// ----------------------------------------------------------------------\nfunction is_promise(o) {\n if (o instanceof QuotedPromise) {\n return false;\n }\n if (o instanceof Promise) {\n return true;\n }\n return o && is_function(o.then);\n}\n// ----------------------------------------------------------------------\nfunction is_undef(value) {\n return typeof value === 'undefined';\n}\n// ----------------------------------------------------------------------\n// :: Function utilities\n// ----------------------------------------------------------------------\nfunction box(object) {\n // we only need to box lips data, arrays and object don't need\n // to be boxed, values from objects will be boxed when accessed\n switch (typeof object) {\n case 'string':\n return LString(object);\n case 'bigint':\n return LNumber(object);\n case 'number':\n if (Number.isNaN(object)) {\n return nan;\n } else {\n return LNumber(object);\n }\n }\n return object;\n}\n// ----------------------------------------------------------------------\nfunction map_object(object, fn) {\n const props = Object.getOwnPropertyNames(object);\n const symbols = Object.getOwnPropertySymbols(object);\n props.concat(symbols).forEach(key => {\n const value = fn(object[key]);\n // check if property is read only, happen with webpack\n // and __esModule, it can happen for other properties as well\n const descriptor = Object.getOwnPropertyDescriptor(object, key);\n if (!descriptor || descriptor.writable && object[key] !== value) {\n object[key] = value;\n }\n });\n return object;\n}\n// ----------------------------------------------------------------------\nfunction unbox(object) {\n var lips_type = [LString, LCharacter, LNumber].some(x => object instanceof x);\n if (lips_type) {\n return object.valueOf();\n }\n if (object instanceof Array) {\n return object.map(unbox);\n }\n if (object instanceof QuotedPromise) {\n delete object.then;\n }\n if (is_plain_object(object)) {\n return map_object(object, unbox);\n }\n return object;\n}\n// ----------------------------------------------------------------------\nfunction patch_value(value, context) {\n if (value instanceof Pair) {\n value.markCycles();\n return quote(value);\n }\n if (is_function(value)) {\n // original function can be restored using unbind function\n // only real JS function require to be bound\n if (context) {\n return bind(value, context);\n }\n }\n return box(value);\n}\n// ----------------------------------------------------------------------\n// :: function get original function that was binded with props\n// ----------------------------------------------------------------------\nfunction unbind(obj) {\n if (is_bound(obj)) {\n return obj[__fn__];\n }\n return obj;\n}\n// ----------------------------------------------------------------------\n// :: function bind with context that can be optionally unbind\n// :: get original function with unbind\n// ----------------------------------------------------------------------\nfunction bind(fn, context) {\n if (fn[Symbol.for('__bound__')]) {\n return fn;\n }\n const bound = fn.bind(context);\n const props = Object.getOwnPropertyNames(fn);\n for (var prop of props) {\n if (filter_fn_names(prop)) {\n try {\n bound[prop] = fn[prop];\n } catch (e) {\n // ignore error from express.js while accessing bodyParser\n }\n }\n }\n hidden_prop(bound, '__fn__', fn);\n hidden_prop(bound, '__context__', context);\n hidden_prop(bound, '__bound__', true);\n if (is_native_function(fn)) {\n hidden_prop(bound, '__native__', true);\n }\n if (is_plain_object(context) && is_lambda(fn)) {\n hidden_prop(bound, '__method__', true);\n }\n bound.valueOf = function() {\n return fn;\n };\n return bound;\n}\n// ----------------------------------------------------------------------\n// function used to check if function should not get unboxed arguments,\n// so you can call Object.getPrototypeOf for lips data types\n// this is case, see dir function and #73\n// ----------------------------------------------------------------------\nfunction is_object_bound(obj) {\n return is_bound(obj) && obj[Symbol.for('__context__')] === Object;\n}\n// ----------------------------------------------------------------------\nfunction is_bound(obj) {\n return !!(is_function(obj) && obj[__fn__]);\n}\n// ----------------------------------------------------------------------\nfunction lips_context(obj) {\n if (is_function(obj)) {\n var context = obj[__context__];\n if (context && (context === lips ||\n (context.constructor &&\n context.constructor.__class__))) {\n return true;\n }\n }\n return false;\n}\n// ----------------------------------------------------------------------\nfunction is_port(obj) {\n return obj instanceof InputPort || obj instanceof OutputPort;\n}\n// ----------------------------------------------------------------------\nfunction is_port_method(obj) {\n if (is_function(obj)) {\n if (is_port(obj[__context__])) {\n return true;\n }\n }\n return false;\n}\n// ----------------------------------------------------------------------\n// hidden props\n// ----------------------------------------------------------------------\nvar __context__ = Symbol.for('__context__');\nvar __fn__ = Symbol.for('__fn__');\nvar __data__ = Symbol.for('__data__');\nvar __ref__ = Symbol.for('__ref__');\nvar __cycles__ = Symbol.for('__cycles__');\nvar __class__ = Symbol.for('__class__');\nvar __method__ = Symbol.for('__method__');\nvar __prototype__ = Symbol.for('__prototype__');\nvar __lambda__ = Symbol.for('__lambda__');\n// ----------------------------------------------------------------------\n// :: function bind fn with context but it also move all props\n// :: mostly used for Object function\n// ----------------------------------------------------------------------\nvar exluded_names = ['name', 'length', 'caller', 'callee', 'arguments', 'prototype'];\nfunction filter_fn_names(name) {\n return !exluded_names.includes(name);\n}\n// ----------------------------------------------------------------------\nfunction hidden_prop(obj, name, value) {\n Object.defineProperty(obj, Symbol.for(name), {\n get: () => value,\n set: () => {},\n configurable: false,\n enumerable: false\n });\n}\n// ----------------------------------------------------------------------\nfunction set_fn_length(fn, length) {\n try {\n Object.defineProperty(fn, 'length', {\n get: function() {\n return length;\n }\n });\n return fn;\n } catch (e) {\n // hack that create function with specific length should work for browsers\n // that don't support Object.defineProperty like old IE\n var args = new Array(length).fill(0).map((_, i) => 'a' + i).join(',');\n var wrapper = new Function(`f`, `return function(${args}) {\n return f.apply(this, arguments);\n };`);\n return wrapper(fn);\n }\n}\n// ----------------------------------------------------------------------\nfunction is_lambda(obj) {\n return obj && obj[__lambda__];\n}\n// ----------------------------------------------------------------------\nfunction is_method(obj) {\n return obj && obj[__method__];\n}\n// ----------------------------------------------------------------------\nfunction is_raw_lambda(fn) {\n return is_lambda(fn) && !fn[__prototype__] &&\n !is_method(fn) && !is_port_method(fn);\n}\n// ----------------------------------------------------------------------\nfunction is_native_function(fn) {\n var native = Symbol.for('__native__');\n return is_function(fn) &&\n fn.toString().match(/\\{\\s*\\[native code\\]\\s*\\}/) &&\n ((fn.name.match(/^bound /) && fn[native] === true) ||\n (!fn.name.match(/^bound /) && !fn[native]));\n}\n// ----------------------------------------------------------------------\n// :: function that return macro for let, let* and letrec\n// ----------------------------------------------------------------------\nfunction let_macro(symbol) {\n var name;\n switch (symbol) {\n case Symbol.for('letrec'):\n name = 'letrec';\n break;\n case Symbol.for('let'):\n name = 'let';\n break;\n case Symbol.for('let*'):\n name = 'let*';\n break;\n default:\n throw new Error('Invalid let_macro value');\n }\n return Macro.defmacro(name, function(code, options) {\n var { dynamic_scope, error, macro_expand } = options;\n var args;\n // named let:\n // (let iter ((x 10)) (iter (- x 1))) -> (let* ((iter (lambda (x) ...\n if (code.car instanceof LSymbol) {\n if (!(code.cdr.car instanceof Pair || code.cdr.car === nil)) {\n throw new Error('let require list of pairs');\n }\n var params;\n if (code.cdr.car === nil) {\n args = nil;\n params = nil;\n } else {\n params = code.cdr.car.map(pair => pair.car);\n args = code.cdr.car.map(pair => pair.cdr.car);\n }\n return Pair.fromArray([\n LSymbol('letrec'),\n [[code.car, Pair(\n LSymbol('lambda'),\n Pair(params, code.cdr.cdr))]],\n Pair(code.car, args)\n ]);\n } else if (macro_expand) {\n // Macro.defmacro are special macros that should return lisp code\n // here we use evaluate, so we need to check special flag set by\n // macroexpand to prevent evaluation of code in normal let\n return;\n }\n var self = this;\n args = global_env.get('list->array')(code.car);\n var env = self.inherit(name);\n var values, var_body_env;\n if (name === 'let*') {\n var_body_env = env;\n } else if (name === 'let') {\n values = []; // collect potential promises\n }\n var i = 0;\n function exec() {\n var output = new Pair(new LSymbol('begin'), code.cdr);\n return evaluate(output, {\n env,\n dynamic_scope,\n error\n });\n }\n return (function loop() {\n var pair = args[i++];\n if (dynamic_scope) {\n dynamic_scope = name === 'let*' ? env : self;\n }\n if (!pair) {\n // resolve all promises\n if (values && values.length) {\n var v = values.map(x => x.value);\n var promises = v.filter(is_promise);\n if (promises.length) {\n return promise_all(v).then((arr) => {\n for (var i = 0, len = arr.length; i < len; ++i) {\n env.set(values[i].name, arr[i]);\n }\n }).then(exec);\n } else {\n for (let { name, value } of values) {\n env.set(name, value);\n }\n }\n }\n return exec();\n } else {\n if (name === 'let') {\n var_body_env = self;\n } else if (name === 'letrec') {\n var_body_env = env;\n }\n var value = evaluate(pair.cdr.car, {\n env: var_body_env,\n dynamic_scope,\n error\n });\n if (name === 'let*') {\n var_body_env = env = var_body_env.inherit('let*[' + i + ']');\n }\n if (values) {\n values.push({ name: pair.car, value });\n return loop();\n } else {\n return unpromise(value, function(value) {\n env.set(pair.car, value);\n return loop();\n });\n }\n }\n })();\n });\n}\n// -------------------------------------------------------------------------\nfunction pararel(name, fn) {\n return new Macro(name, function(code, { dynamic_scope, error } = {}) {\n var env = this;\n if (dynamic_scope) {\n dynamic_scope = this;\n }\n var node = code;\n var results = [];\n while (node instanceof Pair) {\n results.push(evaluate(node.car, { env, dynamic_scope, error }));\n node = node.cdr;\n }\n var havePromises = results.filter(is_promise).length;\n if (havePromises) {\n return promise_all(results).then(fn.bind(this));\n } else {\n return fn.call(this, results);\n }\n });\n}\n// -------------------------------------------------------------------------\nfunction guard_math_call(fn, ...args) {\n args.forEach(arg => {\n typecheck('', arg, 'number');\n });\n return fn(...args);\n}\n// ----------------------------------------------------------------------\nfunction pipe(...fns) {\n fns.forEach((fn, i) => {\n typecheck('pipe', fn, 'function', i + 1);\n });\n return (...args) => {\n return fns.reduce((args, f) => [f.apply(this, args)], args)[0];\n };\n}\n// -------------------------------------------------------------------------\nfunction compose(...fns) {\n fns.forEach((fn, i) => {\n typecheck('compose', fn, 'function', i + 1);\n });\n return pipe(...fns.reverse());\n}\n// -------------------------------------------------------------------------\n// :: fold functions generator\n// -------------------------------------------------------------------------\nfunction fold(name, fold) {\n var self = this;\n return function recur(fn, init, ...lists) {\n typecheck(name, fn, 'function');\n if (lists.some(is_null)) {\n if (typeof init === 'number') {\n return LNumber(init);\n }\n return init;\n } else {\n return fold.call(self, recur, fn, init, ...lists);\n }\n };\n}\n// -------------------------------------------------------------------------\nfunction limit_math_op(n, fn) {\n // + 1 so it include function in guard_math_call\n return limit(n + 1, curry(guard_math_call, fn));\n}\n// -------------------------------------------------------------------------\n// some functional magic\nvar single_math_op = curry(limit_math_op, 1);\nvar binary_math_op = curry(limit_math_op, 2);\n// -------------------------------------------------------------------------\nfunction reduce_math_op(fn, init = null) {\n return function(...args) {\n if (init !== null) {\n args = [init, ...args];\n }\n return args.reduce(binary_math_op(fn));\n };\n}\n// -------------------------------------------------------------------------\nfunction curry(fn, ...init_args) {\n typecheck('curry', fn, 'function');\n var len = fn.length;\n return function() {\n var args = init_args.slice();\n function call(...more_args) {\n args = args.concat(more_args);\n if (args.length >= len) {\n return fn.apply(this, args);\n } else {\n return call;\n }\n }\n return call.apply(this, arguments);\n };\n}\n// -------------------------------------------------------------------------\n// return function with limited number of arguments\nfunction limit(n, fn) {\n typecheck('limit', fn, 'function', 2);\n return function(...args) {\n return fn(...args.slice(0, n));\n };\n}\n// -------------------------------------------------------------------------\n// :: character object representation\n// -------------------------------------------------------------------------\nfunction LCharacter(char) {\n if (typeof this !== 'undefined' && !(this instanceof LCharacter) ||\n typeof this === 'undefined') {\n return new LCharacter(char);\n }\n if (char instanceof LString) {\n char = char.valueOf();\n }\n var name;\n if (Array.from(char).length > 1) {\n // this is name\n char = char.toLowerCase();\n if (LCharacter.__names__[char]) {\n name = char;\n char = LCharacter.__names__[char];\n } else {\n // this should never happen\n // parser don't allow not defined named characters\n throw new Error('Internal: Unknown named character');\n }\n } else {\n name = LCharacter.__rev_names__[char];\n }\n Object.defineProperty(this, '__char__', {\n value: char,\n enumerable: true\n });\n if (name) {\n Object.defineProperty(this, '__name__', {\n value: name,\n enumerable: true\n });\n }\n}\nLCharacter.__names__ = characters;\nLCharacter.__rev_names__ = {};\nObject.keys(LCharacter.__names__).forEach(key => {\n var value = LCharacter.__names__[key];\n LCharacter.__rev_names__[value] = key;\n});\nLCharacter.prototype.toUpperCase = function() {\n return LCharacter(this.__char__.toUpperCase());\n};\nLCharacter.prototype.toLowerCase = function() {\n return LCharacter(this.__char__.toLowerCase());\n};\nLCharacter.prototype.toString = function() {\n return '#\\\\' + (this.__name__ || this.__char__);\n};\nLCharacter.prototype.valueOf = LCharacter.prototype.serialize = function() {\n return this.__char__;\n};\n// -------------------------------------------------------------------------\n// :: String wrapper that handle copy and in place change\n// -------------------------------------------------------------------------\nfunction LString(string) {\n if (typeof this !== 'undefined' && !(this instanceof LString) ||\n typeof this === 'undefined') {\n return new LString(string);\n }\n if (string instanceof Array) {\n this.__string__ = string.map((x, i) => {\n typecheck('LString', x, 'character', i + 1);\n return x.toString();\n }).join('');\n } else {\n this.__string__ = string.valueOf();\n }\n}\n{\n const ignore = ['length', 'constructor'];\n const _keys = Object.getOwnPropertyNames(String.prototype).filter(name => {\n return !ignore.includes(name);\n });\n const wrap = (fn) => function(...args) {\n return fn.apply(this.__string__, args);\n };\n for (let key of _keys) {\n LString.prototype[key] = wrap(String.prototype[key]);\n }\n}\nLString.prototype.serialize = function() {\n return this.valueOf();\n};\nLString.isString = function(x) {\n return x instanceof LString || typeof x === 'string';\n};\nLString.prototype.get = function(n) {\n typecheck('LString::get', n, 'number');\n return Array.from(this.__string__)[n.valueOf()];\n};\nLString.prototype.cmp = function(string) {\n typecheck('LString::cmp', string, 'string');\n var a = this.valueOf();\n var b = string.valueOf();\n if (a < b) {\n return -1;\n } else if (a === b) {\n return 0;\n } else {\n return 1;\n }\n};\nLString.prototype.lower = function() {\n return LString(this.__string__.toLowerCase());\n};\nLString.prototype.upper = function() {\n return LString(this.__string__.toUpperCase());\n};\nLString.prototype.set = function(n, char) {\n typecheck('LString::set', n, 'number');\n typecheck('LString::set', char, ['string', 'character']);\n n = n.valueOf();\n if (char instanceof LCharacter) {\n char = char.__char__;\n }\n var string = [];\n if (n > 0) {\n string.push(this.__string__.substring(0, n));\n }\n string.push(char);\n if (n < this.__string__.length - 1) {\n string.push(this.__string__.substring(n + 1));\n }\n this.__string__ = string.join('');\n};\nObject.defineProperty(LString.prototype, \"length\", {\n get: function() {\n return this.__string__.length;\n }\n});\nLString.prototype.clone = function() {\n return LString(this.valueOf());\n};\nLString.prototype.fill = function(char) {\n typecheck('LString::fill', char, ['string', 'character']);\n if (char instanceof LCharacter) {\n char = char.toString();\n }\n var len = this.__string__.length;\n this.__string__ = new Array(len + 1).join(char);\n};\n// -------------------------------------------------------------------------\n// :: Number wrapper that handle BigNumbers\n// -------------------------------------------------------------------------\nfunction LNumber(n, force = false) {\n if (n instanceof LNumber) {\n return n;\n }\n if (typeof this !== 'undefined' && !(this instanceof LNumber) ||\n typeof this === 'undefined') {\n return new LNumber(n, force);\n }\n if (typeof n === 'undefined') {\n throw new Error('Invalid LNumber constructor call');\n }\n var _type = LNumber.getType(n);\n if (LNumber.types[_type]) {\n return LNumber.types[_type](n, force);\n }\n var parsable = n instanceof Array && LString.isString(n[0]) &&\n LNumber.isNumber(n[1]);\n if (n instanceof LNumber) {\n return LNumber(n.value);\n }\n if (!LNumber.isNumber(n) && !parsable) {\n throw new Error(`You can't create LNumber from ${type(n)}`);\n }\n // prevent infinite loop https://github.com/indutny/bn.js/issues/186\n if (n === null) {\n n = 0;\n }\n var value;\n if (parsable) {\n var [str, radix] = n;\n if (str instanceof LString) {\n str = str.valueOf();\n }\n if (radix instanceof LNumber) {\n radix = radix.valueOf();\n }\n var sign = str.match(/^([+-])/);\n var minus = false;\n if (sign) {\n str = str.replace(/^[+-]/, '');\n if (sign[1] === '-') {\n minus = true;\n }\n }\n }\n if (Number.isNaN(n)) {\n return LFloat(n);\n } else if (typeof BigInt !== 'undefined') {\n if (typeof n !== 'bigint') {\n if (parsable) {\n let prefix;\n // default number base (radix) supported by BigInt constructor\n switch (radix) {\n case 8:\n prefix = '0o';\n break;\n case 16:\n prefix = '0x';\n break;\n case 2:\n prefix = '0b';\n break;\n case 10:\n prefix = '';\n break;\n }\n if (typeof prefix === 'undefined') {\n // non standard radix we convert by hand\n var n_radix = BigInt(radix);\n value = [...str].map((x, i) => {\n return BigInt(parseInt(x, radix)) * pow(n_radix, BigInt(i));\n }).reduce((a, b) => a + b);\n } else {\n value = BigInt(prefix + str);\n }\n } else {\n value = BigInt(n);\n }\n if (minus) {\n value *= BigInt(-1);\n }\n } else {\n value = n;\n }\n return LBigInteger(value, true);\n } else if (typeof BN !== 'undefined' && !(n instanceof BN)) {\n if (n instanceof Array) {\n return LBigInteger(new BN(...n));\n }\n return LBigInteger(new BN(n));\n } else if (parsable) {\n this.constant(parseInt(str, radix), 'integer');\n } else {\n this.constant(n, 'integer');\n }\n}\n// -------------------------------------------------------------------------\nLNumber.prototype.constant = function(value, type) {\n Object.defineProperty(this, '__value__', {\n value,\n enumerable: true\n });\n Object.defineProperty(this, '__type__', {\n value: type,\n enumerable: true\n });\n};\n// -------------------------------------------------------------------------\nLNumber.types = {\n float: function(n, force = false) {\n return new LFloat(n, force);\n },\n complex: function(n, force = false) {\n if (!LNumber.isComplex(n)) {\n n = { im: 0, re: n };\n }\n return new LComplex(n, force);\n },\n rational: function(n, force = false) {\n if (!LNumber.isRational(n)) {\n n = { num: n, denom: 1 };\n }\n return new LRational(n, force);\n }\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.serialize = function() {\n return this.__value__;\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.isNaN = function() {\n return Number.isNaN(this.__value__);\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.gcd = function(b) {\n // ref: https://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\n var a = this.abs();\n b = b.abs();\n if (b.cmp(a) === 1) {\n var temp = a;\n a = b;\n b = temp;\n }\n while (true) {\n a = a.rem(b);\n if (a.cmp(0) === 0) {\n return b;\n }\n b = b.rem(a);\n if (b.cmp(0) === 0) {\n return a;\n }\n }\n};\n// -------------------------------------------------------------------------\nLNumber.isFloat = function isFloat(n) {\n return n instanceof LFloat || (Number(n) === n && n % 1 !== 0);\n};\n// -------------------------------------------------------------------------\nLNumber.isNumber = function(n) {\n return n instanceof LNumber ||\n (LNumber.isNative(n) || LNumber.isBN(n));\n};\n// -------------------------------------------------------------------------\nLNumber.isComplex = function(n) {\n if (!n) {\n return false;\n }\n var ret = n instanceof LComplex ||\n ((LNumber.isNumber(n.im) || Number.isNaN(n.im)) &&\n (LNumber.isNumber(n.re) || Number.isNaN(n.re)));\n return ret;\n};\n// -------------------------------------------------------------------------\nLNumber.isRational = function(n) {\n if (!n) {\n return false;\n }\n return n instanceof LRational ||\n (LNumber.isNumber(n.num) && LNumber.isNumber(n.denom));\n};\n// -------------------------------------------------------------------------\nLNumber.isInteger = function(n) {\n if (!(LNumber.isNative(n) || n instanceof LNumber)) {\n return false;\n }\n if (LNumber.isFloat(n)) {\n return false;\n }\n if (LNumber.isRational(n)) {\n return false;\n }\n if (LNumber.isComplex(n)) {\n return false;\n }\n return true;\n};\n// -------------------------------------------------------------------------\nLNumber.isNative = function(n) {\n return typeof n === 'bigint' || typeof n === 'number';\n};\n// -------------------------------------------------------------------------\nLNumber.isBigInteger = function(n) {\n return n instanceof LBigInteger || typeof n === 'bigint' ||\n LNumber.isBN(n);\n};\n// -------------------------------------------------------------------------\nLNumber.isBN = function(n) {\n return typeof BN !== 'undefined' && n instanceof BN;\n};\n// -------------------------------------------------------------------------\nLNumber.getArgsType = function(a, b) {\n if (a instanceof LFloat || b instanceof LFloat) {\n return LFloat;\n }\n if (a instanceof LBigInteger || b instanceof LBigInteger) {\n return LBigInteger;\n }\n return LNumber;\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.toString = function(radix) {\n if (Number.isNaN(this.__value__)) {\n return '+nan.0';\n }\n if (radix > 2 && radix < 36) {\n return this.__value__.toString(radix);\n }\n return this.__value__.toString();\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.asType = function(n) {\n var _type = LNumber.getType(this);\n return LNumber.types[_type] ? LNumber.types[_type](n) : LNumber(n);\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.isBigNumber = function() {\n return typeof this.__value__ === 'bigint' ||\n typeof BN !== 'undefined' && !(this.value instanceof BN);\n};\n// -------------------------------------------------------------------------\n['floor', 'ceil', 'round'].forEach(fn => {\n LNumber.prototype[fn] = function() {\n if (this.float || LNumber.isFloat(this.__value__)) {\n return LNumber(Math[fn](this.__value__));\n } else {\n return LNumber(Math[fn](this.valueOf()));\n }\n };\n});\n// -------------------------------------------------------------------------\nLNumber.prototype.valueOf = function() {\n if (LNumber.isNative(this.__value__)) {\n return Number(this.__value__);\n } else if (LNumber.isBN(this.__value__)) {\n return this.__value__.toNumber();\n }\n};\n// -------------------------------------------------------------------------\n// type coercion matrix\n// -------------------------------------------------------------------------\nconst matrix = (function() {\n var i = (a, b) => [a, b];\n return {\n bigint: {\n bigint: i,\n float: (a, b) => [LFloat(a.valueOf(), true), b],\n rational: (a, b) => [{ num: a, denom: 1 }, b],\n complex: (a, b) => [{ im: 0, re: a }, b]\n },\n integer: {\n integer: i,\n float: (a, b) => [LFloat(a.valueOf(), true), b],\n rational: (a, b) => [{ num: a, denom: 1 }, b],\n complex: (a, b) => [{ im: 0, re: a }, b]\n },\n float: {\n bigint: (a, b) => [a, b && LFloat(b.valueOf(), true)],\n integer: (a, b) => [a, b && LFloat(b.valueOf(), true)],\n float: i,\n rational: (a, b) => [a, b && LFloat(b.valueOf(), true)],\n complex: (a, b) => [{ re: a, im: LFloat(0, true) }, b]\n },\n complex: {\n bigint: complex('bigint'),\n integer: complex('integer'),\n float: complex('float'),\n rational: complex('rational'),\n complex: (a, b) => {\n const [a_re, b_re] = LNumber.coerce(a.__re__, b.__re__);\n const [a_im, b_im] = LNumber.coerce(a.__im__, b.__im__);\n return [\n { im: a_im, re: a_re },\n { im: b_im, re: b_re }\n ];\n }\n },\n rational: {\n bigint: (a, b) => [a, b && { num: b, denom: 1 }],\n integer: (a, b) => [a, b && { num: b, denom: 1 }],\n float: (a, b) => [LFloat(a.valueOf()), b],\n rational: i,\n complex: (a, b) => {\n return [\n {\n im: coerce(a.__type__, b.__im__.__type__, 0)[0],\n re: coerce(a.__type__, b.__re__.__type__, a)[0]\n },\n {\n im: coerce(a.__type__, b.__im__.__type__, b.__im__)[0],\n re: coerce(a.__type__, b.__re__.__type__, b.__re__)[0]\n }\n ];\n }\n }\n };\n function complex(type) {\n return (a, b) => {\n return [\n {\n im: coerce(type, a.__im__.__type__, 0, a.__im__)[1],\n re: coerce(type, a.__re__.__type__, 0, a.__re__)[1]\n },\n {\n im: coerce(type, a.__im__.__type__, 0, 0)[1],\n re: coerce(type, b.__type__, 0, b)[1]\n }\n ];\n };\n }\n})();\n// -------------------------------------------------------------------------\nfunction coerce(type_a, type_b, a, b) {\n return matrix[type_a][type_b](a, b);\n}\n// -------------------------------------------------------------------------\nLNumber.coerce = function(a, b) {\n const a_type = LNumber.getType(a);\n const b_type = LNumber.getType(b);\n if (!matrix[a_type]) {\n throw new Error(`LNumber::coerce unknown lhs type ${a_type}`);\n } else if (!matrix[a_type][b_type]) {\n throw new Error(`LNumber::coerce unknown rhs type ${b_type}`);\n }\n var tmp = matrix[a_type][b_type](a, b);\n return tmp.map(n => LNumber(n, true));\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.coerce = function(n) {\n if (!(typeof n === 'number' || n instanceof LNumber)) {\n throw new Error(`LNumber: you can't coerce ${type(n)}`);\n }\n if (typeof n === 'number') {\n n = LNumber(n);\n }\n return LNumber.coerce(this, n);\n};\n// -------------------------------------------------------------------------\nLNumber.getType = function(n) {\n if (n instanceof LNumber) {\n return n.__type__;\n }\n if (LNumber.isFloat(n)) {\n return 'float';\n }\n if (LNumber.isComplex(n)) {\n return 'complex';\n }\n if (LNumber.isRational(n)) {\n return 'rational';\n }\n if (typeof n === 'number') {\n return 'integer';\n }\n if ((typeof BigInt !== 'undefined' && typeof n !== 'bigint') ||\n (typeof BN !== 'undefined' && !(n instanceof BN))) {\n return 'bigint';\n }\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.isFloat = function() {\n return !!(LNumber.isFloat(this.__value__) || this.float);\n};\n// -------------------------------------------------------------------------\nvar mapping = {\n 'add': '+',\n 'sub': '-',\n 'mul': '*',\n 'div': '/',\n 'rem': '%',\n 'or': '|',\n 'and': '&',\n 'neg': '~',\n 'shl': '>>',\n 'shr': '<<'\n};\nvar rev_mapping = {};\nObject.keys(mapping).forEach((key) => {\n rev_mapping[mapping[key]] = key;\n LNumber.prototype[key] = function(n) {\n return this.op(mapping[key], n);\n };\n});\n// -------------------------------------------------------------------------\nLNumber._ops = {\n '*': function(a, b) {\n return a * b;\n },\n '+': function(a, b) {\n return a + b;\n },\n '-': function(a, b) {\n if (typeof b === 'undefined') {\n return -a;\n }\n return a - b;\n },\n '/': function(a, b) {\n return a / b;\n },\n '%': function(a, b) {\n return a % b;\n },\n '|': function(a, b) {\n return a | b;\n },\n '&': function(a, b) {\n return a & b;\n },\n '~': function(a) {\n return ~a;\n },\n '>>': function(a, b) {\n return a >> b;\n },\n '<<': function(a, b) {\n return a << b;\n }\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.op = function(op, n) {\n if (typeof n === 'undefined') {\n return LNumber(LNumber._ops[op](this.valueOf()));\n }\n if (typeof n === 'number') {\n n = LNumber(n);\n }\n if (Number.isNaN(this.__value__) && !LNumber.isComplex(n) ||\n !LNumber.isComplex(this) && Number.isNaN(n.__value__)) {\n return LNumber(NaN);\n }\n const [a, b] = this.coerce(n);\n if (a._op) {\n return a._op(op, b);\n }\n return LNumber(LNumber._ops[op](a, b));\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.sqrt = function() {\n var value = this.valueOf();\n if (this.cmp(0) < 0) {\n var im = Math.sqrt(-value);\n return LComplex({ re: 0, im });\n }\n return LNumber(Math.sqrt(value));\n};\n// -------------------------------------------------------------------------\nvar pow = function(a, b) {\n var e = typeof a === 'bigint' ? BigInt(1) : 1;\n return new Array(Number(b)).fill(0).reduce(x => x * a, e);\n};\n// -------------------------------------------------------------------------\n// use native exponential operator if possible (it's way faster)\n// -------------------------------------------------------------------------\nvar exp_op = new Function('a,b', 'return a ** b');\ntry {\n if (exp_op(2, 2) === 4) {\n pow = exp_op;\n }\n} catch (e) {\n // ignore\n}\n// -------------------------------------------------------------------------\nLNumber.prototype.pow = function(n) {\n var value;\n if (LNumber.isBN(this.__value__)) {\n value = this.__value__.pow(n.__value__);\n } else {\n value = pow(this.__value__, n.__value__);\n }\n return LNumber(value);\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.abs = function() {\n var value = this.__value__;\n if (LNumber.isNative(this.__value__)) {\n if (value < 0) {\n value = -value;\n }\n } else if (LNumber.isBN(value)) {\n value.iabs();\n }\n return new LNumber(value);\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.isOdd = function() {\n if (LNumber.isNative(this.__value__)) {\n if (this.isBigNumber()) {\n return this.__value__ % BigInt(2) === BigInt(1);\n }\n return this.__value__ % 2 === 1;\n } else if (LNumber.isBN(this.__value__)) {\n return this.__value__.isOdd();\n }\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.isEven = function() {\n return !this.isOdd();\n};\n// -------------------------------------------------------------------------\nLNumber.prototype.cmp = function(n) {\n const [a, b] = this.coerce(n);\n function cmp(a, b) {\n if (a.__value__ < b.__value__) {\n return -1;\n } else if (a.__value__ === b.__value__) {\n return 0;\n } else {\n return 1;\n }\n }\n if (a.__type__ === 'bigint') {\n if (LNumber.isNative(a.__value__)) {\n return cmp(a, b);\n } else if (LNumber.isBN(a.__value__)) {\n return this.__value__.cmp(b.__value__);\n }\n } else if (a instanceof LFloat) {\n return cmp(a, b);\n }\n};\n// -------------------------------------------------------------------------\n// :: COMPLEX TYPE\n// -------------------------------------------------------------------------\nfunction LComplex(n, force = false) {\n if (typeof this !== 'undefined' && !(this instanceof LComplex) ||\n typeof this === 'undefined') {\n return new LComplex(n, force);\n }\n if (n instanceof LComplex) {\n return LComplex({ im: n.__im__, re: n.__re__ });\n }\n if (LNumber.isNumber(n) && force) {\n if (!force) {\n return Number(n);\n }\n } else if (!LNumber.isComplex(n)) {\n throw new Error('Invalid constructor call for LComplex');\n }\n var im = n.im instanceof LNumber ? n.im : LNumber(n.im);\n var re = n.re instanceof LNumber ? n.re : LNumber(n.re);\n this.constant(im, re);\n}\n// -------------------------------------------------------------------------\nLComplex.prototype = Object.create(LNumber.prototype);\nLComplex.prototype.constructor = LComplex;\n// -------------------------------------------------------------------------\nLComplex.prototype.constant = function(im, re) {\n Object.defineProperty(this, '__im__', {\n value: im,\n enumerable: true\n });\n Object.defineProperty(this, '__re__', {\n value: re,\n enumerable: true\n });\n Object.defineProperty(this, '__type__', {\n value: 'complex',\n enumerable: true\n });\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.serialize = function() {\n return {\n re: this.__re__,\n im: this.__im__\n };\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.toRational = function(n) {\n if (LNumber.isFloat(this.__im__) && LNumber.isFloat(this.__re__)) {\n const im = LFloat(this.__im__).toRational(n);\n const re = LFloat(this.__re__).toRational(n);\n return LComplex({ im, re });\n }\n return this;\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.add = function(n) {\n return this.complex_op('add', n, function(a_re, b_re, a_im, b_im) {\n return {\n re: a_re.add(b_re),\n im: a_im.add(b_im)\n };\n });\n};\n// -------------------------------------------------------------------------\n// :: factor is used in / and modulus\n// -------------------------------------------------------------------------\nLComplex.prototype.factor = function() {\n // fix rounding when calculating (/ 1.0 1/10+1/10i)\n if (this.__im__ instanceof LFloat || this.__im__ instanceof LFloat) {\n let { __re__: re, __im__: im } = this;\n let x, y;\n if (re instanceof LFloat) {\n x = re.toRational().mul(re.toRational());\n } else {\n x = re.mul(re);\n }\n if (im instanceof LFloat) {\n y = im.toRational().mul(im.toRational());\n } else {\n y = im.mul(im);\n }\n return x.add(y);\n } else {\n return this.__re__.mul(this.__re__).add(this.__im__.mul(this.__im__));\n }\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.modulus = function() {\n return this.factor().sqrt();\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.conjugate = function() {\n return LComplex({ re: this.__re__, im: this.__im__.sub() });\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.sqrt = function() {\n const r = this.modulus();\n // code based ok Kawa Scheme source code (file DComplex.java)\n // Copyright (c) 1997 Per M.A. Bothner.\n // Released under MIT License\n let re, im;\n if (r.cmp(0) === 0) {\n re = im = r;\n } else if (this.__re__.cmp(0) === 1) {\n re = LFloat(0.5).mul(r.add(this.__re__)).sqrt();\n im = this.__im__.div(re).div(2);\n } else {\n im = LFloat(0.5).mul(r.sub(this.__re__)).sqrt();\n if (this.__im__.cmp(0) === -1) {\n im = im.sub();\n }\n re = this.__im__.div(im).div(2);\n }\n return LComplex({ im, re });\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.div = function(n) {\n if (LNumber.isNumber(n) && !LNumber.isComplex(n)) {\n if (!(n instanceof LNumber)) {\n n = LNumber(n);\n }\n const re = this.__re__.div(n);\n const im = this.__im__.div(n);\n return LComplex({ re, im });\n } else if (!LNumber.isComplex(n)) {\n throw new Error('[LComplex::div] Invalid value');\n }\n const [ a, b ] = this.coerce(n);\n const denom = b.factor();\n const num = a.mul(b.conjugate());\n const re = num.__re__.op('/', denom);\n const im = num.__im__.op('/', denom);\n return LComplex({ re, im });\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.sub = function(n) {\n return this.complex_op('sub', n, function(a_re, b_re, a_im, b_im) {\n return {\n re: a_re.sub(b_re),\n im: a_im.sub(b_im)\n };\n });\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.mul = function(n) {\n return this.complex_op('mul', n, function(a_re, b_re, a_im, b_im) {\n var ret = {\n re: a_re.mul(b_re).sub(a_im.mul(b_im)),\n im: a_re.mul(b_im).add(b_re.mul(a_im))\n };\n return ret;\n });\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.complex_op = function(name, n, fn) {\n const calc = (re, im) => {\n var result = fn(this.__re__, re, this.__im__, im);\n if ('im' in result && 're' in result) {\n if (result.im.cmp(0) === 0 && !LNumber.isFloat(result.im)) {\n return result.re;\n }\n return LComplex(result, true);\n }\n return result;\n };\n if (typeof n === 'undefined') {\n return calc();\n }\n if (LNumber.isNumber(n) && !LNumber.isComplex(n)) {\n if (!(n instanceof LNumber)) {\n n = LNumber(n);\n }\n const im = n.asType(0);\n n = { __im__: im, __re__: n };\n } else if (!LNumber.isComplex(n)) {\n throw new Error(`[LComplex::${name}] Invalid value`);\n }\n var re = n.__re__ instanceof LNumber ? n.__re__ : this.__re__.asType(n.__re__);\n var im = n.__im__ instanceof LNumber ? n.__im__ : this.__im__.asType(n.__im__);\n return calc(re, im);\n};\n// -------------------------------------------------------------------------\nLComplex._op = {\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div'\n};\n// -------------------------------------------------------------------------\nLComplex.prototype._op = function(op, n) {\n const fn = LComplex._op[op];\n return this[fn](n);\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.cmp = function(n) {\n const [a, b] = this.coerce(n);\n const [re_a, re_b] = a.__re__.coerce(b.__re__);\n const re_cmp = re_a.cmp(re_b);\n if (re_cmp !== 0) {\n return re_cmp;\n } else {\n const [im_a, im_b] = a.__im__.coerce(b.__im__);\n return im_a.cmp(im_b);\n }\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.valueOf = function() {\n return [this.__re__, this.__im__].map(x => x.valueOf());\n};\n// -------------------------------------------------------------------------\nLComplex.prototype.toString = function() {\n var result;\n if (this.__re__.cmp(0) !== 0) {\n result = [toString(this.__re__)];\n } else {\n result = [];\n }\n // NaN and inf already have sign\n var im = this.__im__.valueOf();\n var inf = [Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY].includes(im);\n var im_str = toString(this.__im__);\n if (!inf && !Number.isNaN(im)) {\n var zero_check = this.__im__.cmp(0);\n if (zero_check < 0 || (zero_check === 0 && this.__im__._minus)) {\n result.push('-');\n } else {\n result.push('+');\n }\n im_str = im_str.replace(/^-/, '');\n }\n result.push(im_str);\n result.push('i');\n return result.join('');\n};\n// -------------------------------------------------------------------------\n// :: FLOAT TYPE\n// -------------------------------------------------------------------------\nfunction LFloat(n) {\n if (typeof this !== 'undefined' && !(this instanceof LFloat) ||\n typeof this === 'undefined') {\n return new LFloat(n);\n }\n if (!LNumber.isNumber(n)) {\n throw new Error('Invalid constructor call for LFloat');\n }\n if (n instanceof LNumber) {\n return LFloat(n.valueOf());\n }\n if (typeof n === 'number') {\n if (Object.is(n, -0)) {\n Object.defineProperty(this, '_minus', {\n value: true\n });\n }\n this.constant(n, 'float');\n }\n}\n// -------------------------------------------------------------------------\nLFloat.prototype = Object.create(LNumber.prototype);\nLFloat.prototype.constructor = LFloat;\n// -------------------------------------------------------------------------\nLFloat.prototype.toString = function() {\n if (this.__value__ === Number.NEGATIVE_INFINITY) {\n return '-inf.0';\n }\n if (this.__value__ === Number.POSITIVE_INFINITY) {\n return '+inf.0';\n }\n if (Number.isNaN(this.__value__)) {\n return '+nan.0';\n }\n var str = this.__value__.toString();\n if (!LNumber.isFloat(this.__value__) && !str.match(/e/i)) {\n var result = str + '.0';\n return this._minus ? ('-' + result) : result;\n }\n return str.replace(/^([0-9]+)e/, '$1.0e');\n};\n// -------------------------------------------------------------------------\nLFloat.prototype._op = function(op, n) {\n if (n instanceof LNumber) {\n n = n.__value__;\n }\n const fn = LNumber._ops[op];\n if (op === '/' && this.__value__ === 0 && n === 0) {\n return NaN;\n }\n return LFloat(fn(this.__value__, n), true);\n};\n// -------------------------------------------------------------------------\n// same approximation as in guile scheme\nLFloat.prototype.toRational = function(n = null) {\n if (n === null) {\n return toRational(this.__value__.valueOf());\n }\n return approxRatio(n.valueOf())(this.__value__.valueOf());\n};\n// -------------------------------------------------------------------------\nLFloat.prototype.sqrt = function() {\n var value = this.valueOf();\n if (this.cmp(0) < 0) {\n var im = LFloat(Math.sqrt(-value));\n return LComplex({ re: 0, im });\n }\n return LFloat(Math.sqrt(value));\n};\n// -------------------------------------------------------------------------\nLFloat.prototype.abs = function() {\n var value = this.valueOf();\n if (value < 0) {\n value = -value;\n }\n return LFloat(value);\n};\n// -------------------------------------------------------------------------\n// ref: https://rosettacode.org/wiki/Convert_decimal_number_to_rational\n// -------------------------------------------------------------------------\nvar toRational = approxRatio(1e-10);\nfunction approxRatio(eps) {\n return function(n) {\n const gcde = (e, x, y) => {\n const _gcd = (a, b) => (b < e ? a : _gcd(b, a % b));\n if (Number.isNaN(x) || Number.isNaN(y)) {\n return NaN;\n }\n return _gcd(Math.abs(x), Math.abs(y));\n },\n c = gcde(eps ? eps : (1 / 10000), 1, n);\n return LRational({ num: Math.floor(n / c), denom: Math.floor(1 / c) });\n };\n}\n// -------------------------------------------------------------------------\n// :: source: Kawa gnu.math.RatNum.java\n// :: This algorithm is by Alan Bawden. It has been transcribed\n// :: with permission from Kawa copyright M.A. Bothner.\n// :: which was transcribed from from C-Gambit, copyright Marc Feeley.\n// -------------------------------------------------------------------------\nfunction rationalize(x, y) {\n var a = x.sub(y);\n var b = x.add(y);\n var result;\n if (a.cmp(b) > 0) {\n result = simplest_rational2(b, a);\n } else if (b.cmp(a) <= 0) {\n result = a;\n } else if (a.cmp(0) > 0) {\n result = simplest_rational2(a, b);\n } else if (y.cmp(0) < 0) {\n result = LNumber(simplest_rational2(b.sub(), a.sub())).sub();\n } else {\n result = LNumber(0);\n }\n if (LNumber.isFloat(y) || LNumber.isFloat(x)) {\n return LFloat(result);\n }\n return result;\n}\n// -------------------------------------------------------------------------\nfunction simplest_rational2(x, y) {\n var fx = LNumber(x).floor();\n var fy = LNumber(y).floor();\n if (x.cmp(fx) < 1) {\n return fx;\n } else if (fx.cmp(fy) === 0) {\n var n = LNumber(1).div(y.sub(fy));\n var d = LNumber(1).div(x.sub(fx));\n return fx.add(LNumber(1).div(simplest_rational2(n, d)));\n } else {\n return fx.add(LNumber(1));\n }\n}\n// -------------------------------------------------------------------------\nfunction LRational(n, force = false) {\n if (typeof this !== 'undefined' && !(this instanceof LRational) ||\n typeof this === 'undefined') {\n return new LRational(n, force);\n }\n if (!LNumber.isRational(n)) {\n throw new Error('Invalid constructor call for LRational');\n }\n var num, denom;\n if (n instanceof LRational) {\n num = LNumber(n.__num__);\n denom = LNumber(n.__denom__);\n } else {\n num = LNumber(n.num);\n denom = LNumber(n.denom);\n }\n if (!force && denom.cmp(0) !== 0) {\n var is_integer = num.op('%', denom).cmp(0) === 0;\n if (is_integer) {\n return LNumber(num.div(denom));\n }\n }\n this.constant(num, denom);\n}\n// -------------------------------------------------------------------------\nLRational.prototype = Object.create(LNumber.prototype);\nLRational.prototype.constructor = LRational;\n// -------------------------------------------------------------------------\nLRational.prototype.constant = function(num, denom) {\n Object.defineProperty(this, '__num__', {\n value: num,\n enumerable: true\n });\n Object.defineProperty(this, '__denom__', {\n value: denom,\n enumerable: true\n });\n Object.defineProperty(this, '__type__', {\n value: 'rational',\n enumerable: true\n });\n};\n// -------------------------------------------------------------------------\nLRational.prototype.serialize = function() {\n return {\n num: this.__num__,\n denom: this.__denom__\n };\n};\n// -------------------------------------------------------------------------\nLRational.prototype.pow = function(n) {\n var cmp = n.cmp(0);\n if (cmp === 0) {\n return LNumber(1);\n }\n if (cmp === -1) {\n n = n.sub();\n var num = this.__denom__.pow(n);\n var denom = this.__num__.pow(n);\n return LRational({ num, denom });\n }\n var result = this;\n n = n.valueOf();\n while (n > 1) {\n result = result.mul(this);\n n--;\n }\n return result;\n};\n// -------------------------------------------------------------------------\nLRational.prototype.sqrt = function() {\n const num = this.__num__.sqrt();\n const denom = this.__denom__.sqrt();\n if (num instanceof LFloat || denom instanceof LFloat) {\n return num.div(denom);\n }\n return LRational({ num, denom });\n};\n// -------------------------------------------------------------------------\nLRational.prototype.abs = function() {\n var num = this.__num__;\n var denom = this.__denom__;\n if (num.cmp(0) === -1) {\n num = num.sub();\n }\n if (denom.cmp(0) !== 1) {\n denom = denom.sub();\n }\n return LRational({ num, denom });\n};\n// -------------------------------------------------------------------------\nLRational.prototype.cmp = function(n) {\n return LNumber(this.valueOf(), true).cmp(n);\n};\n// -------------------------------------------------------------------------\nLRational.prototype.toString = function() {\n var gcd = this.__num__.gcd(this.__denom__);\n var num, denom;\n if (gcd.cmp(1) !== 0) {\n num = this.__num__.div(gcd);\n if (num instanceof LRational) {\n num = LNumber(num.valueOf(true));\n }\n denom = this.__denom__.div(gcd);\n if (denom instanceof LRational) {\n denom = LNumber(denom.valueOf(true));\n }\n } else {\n num = this.__num__;\n denom = this.__denom__;\n }\n const minus = this.cmp(0) < 0;\n if (minus) {\n if (num.abs().cmp(denom.abs()) === 0) {\n return num.toString();\n }\n } else if (num.cmp(denom) === 0) {\n return num.toString();\n }\n return num.toString() + '/' + denom.toString();\n};\n// -------------------------------------------------------------------------\nLRational.prototype.valueOf = function(exact) {\n if (this.__denom__.cmp(0) === 0) {\n if (this.__num__.cmp(0) < 0) {\n return Number.NEGATIVE_INFINITY;\n }\n return Number.POSITIVE_INFINITY;\n }\n if (exact) {\n return LNumber._ops['/'](this.__num__.value, this.__denom__.value);\n }\n return LFloat(this.__num__.valueOf()).div(this.__denom__.valueOf());\n};\n// -------------------------------------------------------------------------\nLRational.prototype.mul = function(n) {\n if (!(n instanceof LNumber)) {\n n = LNumber(n); // handle (--> 1/2 (mul 2))\n }\n if (LNumber.isRational(n)) {\n var num = this.__num__.mul(n.__num__);\n var denom = this.__denom__.mul(n.__denom__);\n return LRational({ num, denom });\n }\n const [a, b] = LNumber.coerce(this, n);\n return a.mul(b);\n};\n// -------------------------------------------------------------------------\nLRational.prototype.div = function(n) {\n if (!(n instanceof LNumber)) {\n n = LNumber(n); // handle (--> 1/2 (div 2))\n }\n if (LNumber.isRational(n)) {\n var num = this.__num__.mul(n.__denom__);\n var denom = this.__denom__.mul(n.__num__);\n return LRational({ num, denom });\n }\n const [a, b] = LNumber.coerce(this, n);\n const ret = a.div(b);\n return ret;\n};\n// -------------------------------------------------------------------------\nLRational.prototype._op = function(op, n) {\n return this[rev_mapping[op]](n);\n};\n// -------------------------------------------------------------------------\nLRational.prototype.sub = function(n) {\n if (typeof n === 'undefined') {\n return this.mul(-1);\n }\n if (!(n instanceof LNumber)) {\n n = LNumber(n); // handle (--> 1/2 (sub 1))\n }\n if (LNumber.isRational(n)) {\n var num = n.__num__.sub();\n var denom = n.__denom__;\n return this.add(LRational({ num, denom }));\n }\n if (!(n instanceof LNumber)) {\n n = LNumber(n).sub();\n } else {\n n = n.sub();\n }\n const [a, b] = LNumber.coerce(this, n);\n return a.add(b);\n};\n// -------------------------------------------------------------------------\nLRational.prototype.add = function(n) {\n if (!(n instanceof LNumber)) {\n n = LNumber(n); // handle (--> 1/2 (add 1))\n }\n if (LNumber.isRational(n)) {\n const a_denom = this.__denom__;\n const b_denom = n.__denom__;\n const a_num = this.__num__;\n const b_num = n.__num__;\n let denom, num;\n if (a_denom !== b_denom) {\n num = b_denom.mul(a_num).add(b_num.mul(a_denom));\n denom = a_denom.mul(b_denom);\n } else {\n num = a_num.add(b_num);\n denom = a_denom;\n }\n return LRational({ num, denom });\n }\n if (LNumber.isFloat(n)) {\n return LFloat(this.valueOf()).add(n);\n }\n const [a, b] = LNumber.coerce(this, n);\n return a.add(b);\n};\n// -------------------------------------------------------------------------\nfunction LBigInteger(n, native) {\n if (typeof this !== 'undefined' && !(this instanceof LBigInteger) ||\n typeof this === 'undefined') {\n return new LBigInteger(n, native);\n }\n if (n instanceof LBigInteger) {\n return LBigInteger(n.__value__, n._native);\n }\n if (!LNumber.isBigInteger(n)) {\n throw new Error('Invalid constructor call for LBigInteger');\n }\n this.constant(n, 'bigint');\n Object.defineProperty(this, '_native', {\n value: native\n });\n}\n// -------------------------------------------------------------------------\nLBigInteger.prototype = Object.create(LNumber.prototype);\nLBigInteger.prototype.constructor = LBigInteger;\n// -------------------------------------------------------------------------\nLBigInteger.bn_op = {\n '+': 'iadd',\n '-': 'isub',\n '*': 'imul',\n '/': 'idiv',\n '%': 'imod',\n '|': 'ior',\n '&': 'iand',\n '~': 'inot',\n '<<': 'ishrn',\n '>>': 'ishln'\n};\nLBigInteger.prototype.serialize = function() {\n return this.__value__.toString();\n};\n// -------------------------------------------------------------------------\nLBigInteger.prototype._op = function(op, n) {\n if (typeof n === 'undefined') {\n if (LNumber.isBN(this.__value__)) {\n op = LBigInteger.bn_op[op];\n return LBigInteger(this.__value__.clone()[op](), false);\n }\n return LBigInteger(LNumber._ops[op](this.__value__), true);\n }\n if (LNumber.isBN(this.__value__) && LNumber.isBN(n.__value__)) {\n op = LBigInteger.bn_op[op];\n return LBigInteger(this.__value__.clone()[op](n), false);\n }\n const ret = LNumber._ops[op](this.__value__, n.__value__);\n if (op === '/') {\n var is_integer = this.op('%', n).cmp(0) === 0;\n if (is_integer) {\n return LNumber(ret);\n }\n return LRational({ num: this, denom: n });\n }\n // use native calculation because it's real bigint value\n return LBigInteger(ret, true);\n};\n// -------------------------- -----------------------------------------------\nLBigInteger.prototype.sqrt = function() {\n var value;\n var minus = this.cmp(0) < 0;\n if (LNumber.isNative(this.__value__)) {\n value = LNumber(Math.sqrt(minus ? -this.valueOf() : this.valueOf()));\n } else if (LNumber.isBN(this.__value__)) {\n value = minus ? this.__value__.neg().sqrt() : this.__value__.sqrt();\n }\n if (minus) {\n return LComplex({ re: 0, im: value });\n }\n return value;\n};\n// -------------------------------------------------------------------------\nLNumber.NaN = LNumber(NaN);\n// -------------------------------------------------------------------------\n// :: Port abstraction - read should be a function that return next line\n// -------------------------------------------------------------------------\nfunction InputPort(read) {\n if (typeof this !== 'undefined' && !(this instanceof InputPort) ||\n typeof this === 'undefined') {\n return new InputPort(read);\n }\n typecheck('InputPort', read, 'function');\n read_only(this, '__type__', text_port);\n var parser;\n Object.defineProperty(this, '__parser__', {\n enumerable: true,\n get: function() {\n return parser;\n },\n set: function(value) {\n typecheck('InputPort::__parser__', value, 'parser');\n parser = value;\n }\n });\n this._read = read;\n this._with_parser = this._with_init_parser.bind(this, async () => {\n if (!this.char_ready()) {\n const line = await this._read();\n parser = new Parser(line, { env: this });\n }\n return this.__parser__;\n });\n this.char_ready = function() {\n return !!this.__parser__ && this.__parser__.__lexer__.peek() !== eof;\n };\n this._make_defaults();\n}\nInputPort.prototype._make_defaults = function() {\n this.read = this._with_parser((parser) => {\n return parser.read_object();\n });\n this.read_line = this._with_parser((parser) => {\n return parser.__lexer__.read_line();\n });\n this.read_char = this._with_parser((parser) => {\n return parser.__lexer__.read_char();\n });\n this.read_string = this._with_parser((parser, number) => {\n if (!LNumber.isInteger(number)) {\n const type = LNumber.getType(number);\n typeErrorMessage('read-string', type, 'integer');\n }\n return parser.__lexer__.read_string(number.valueOf());\n });\n this.peek_char = this._with_parser((parser) => {\n return parser.__lexer__.peek_char();\n });\n};\nInputPort.prototype._with_init_parser = function(make_parser, fn) {\n var self = this;\n return async function(...args) {\n var parser = await make_parser.call(self);\n return fn(parser, ...args);\n };\n};\nInputPort.prototype.is_open = function() {\n return this._with_parser !== null;\n};\nInputPort.prototype.close = function() {\n this.__parser__ = null;\n // make content garbage collected, we assign null,\n // because the value is in prototype\n this._with_parser = null;\n ['read', 'close', 'read_char', 'peek-char', 'read_line'].forEach(name => {\n this[name] = function() {\n throw new Error('input-port: port is closed');\n };\n });\n this.char_ready = function() {\n return false;\n };\n};\nInputPort.prototype.toString = function() {\n return '#';\n};\n// -------------------------------------------------------------------------\nfunction OutputPort(write) {\n if (typeof this !== 'undefined' && !(this instanceof OutputPort) ||\n typeof this === 'undefined') {\n return new OutputPort(write);\n }\n typecheck('OutputPort', write, 'function');\n read_only(this, '__type__', text_port);\n this.write = write;\n}\nOutputPort.prototype.is_open = function() {\n return this._closed !== true;\n};\nOutputPort.prototype.close = function() {\n Object.defineProperty(this, '_closed', {\n get: () => true,\n set: () => {},\n configurable: false,\n enumerable: false\n });\n this.write = function() {\n throw new Error('output-port: port is closed');\n };\n};\nOutputPort.prototype.flush = function() {\n // do nothing\n};\nOutputPort.prototype.toString = function() {\n return '#';\n};\n// -------------------------------------------------------------------------\nclass BufferedOutputPort extends OutputPort {\n constructor(fn) {\n super((...args) => this._write(...args));\n typecheck('BufferedOutputPort', fn, 'function');\n read_only(this, '_fn', fn, { hidden: true });\n read_only(this, '_buffer', [], { hidden: true });\n }\n flush() {\n if (this._buffer.length) {\n this._fn(this._buffer.join(''));\n this._buffer.length = 0;\n }\n }\n _write(...args) {\n if (args.length) {\n args.forEach(arg => {\n this._buffer.push(arg);\n });\n const last_value = this._buffer[this._buffer.length - 1];\n if (last_value.match(/\\n$/)) {\n this._buffer[this._buffer.length - 1] = last_value.replace(/\\n$/, '');\n this.flush();\n }\n }\n }\n}\n// -------------------------------------------------------------------------\nfunction OutputStringPort(toString) {\n if (typeof this !== 'undefined' && !(this instanceof OutputStringPort) ||\n typeof this === 'undefined') {\n return new OutputStringPort(toString);\n }\n typecheck('OutputStringPort', toString, 'function');\n read_only(this, '__type__', text_port);\n read_only(this, '__buffer__', []);\n this.write = (x) => {\n if (!LString.isString(x)) {\n x = toString(x);\n } else {\n x = x.valueOf();\n }\n this.__buffer__.push(x);\n };\n}\nOutputStringPort.prototype = Object.create(OutputPort.prototype);\nOutputStringPort.prototype.constructor = OutputStringPort;\nOutputStringPort.prototype.toString = function() {\n return '#';\n};\nOutputStringPort.prototype.valueOf = function() {\n return this.__buffer__.map(x => x.valueOf()).join('');\n};\n// -------------------------------------------------------------------------\nfunction OutputFilePort(filename, fd) {\n if (typeof this !== 'undefined' && !(this instanceof OutputFilePort) ||\n typeof this === 'undefined') {\n return new OutputFilePort(filename, fd);\n }\n typecheck('OutputFilePort', filename, 'string');\n read_only(this, '__filename__', filename);\n read_only(this, '_fd', fd.valueOf(), { hidden: true });\n read_only(this, '__type__', text_port);\n this.write = (x) => {\n if (!LString.isString(x)) {\n x = toString(x);\n } else {\n x = x.valueOf();\n }\n this.fs().write(this._fd, x, function(err) {\n if (err) {\n throw err;\n }\n });\n };\n}\nOutputFilePort.prototype = Object.create(OutputPort.prototype);\nOutputFilePort.prototype.constructor = OutputFilePort;\nOutputFilePort.prototype.fs = function() {\n if (!this._fs) {\n this._fs = this.internal('fs');\n }\n return this._fs;\n};\nOutputFilePort.prototype.internal = function(name) {\n return user_env.get('**internal-env**').get(name);\n};\nOutputFilePort.prototype.close = function() {\n return new Promise((resolve, reject) => {\n this.fs().close(this._fd, (err) => {\n if (err) {\n reject(err);\n } else {\n read_only(this, '_fd', null, { hidden: true });\n OutputPort.prototype.close.call(this);\n resolve();\n }\n });\n });\n};\nOutputFilePort.prototype.toString = function() {\n return `#`;\n};\n// -------------------------------------------------------------------------\nfunction InputStringPort(string, env) {\n if (typeof this !== 'undefined' && !(this instanceof InputStringPort) ||\n typeof this === 'undefined') {\n return new InputStringPort(string);\n }\n typecheck('InputStringPort', string, 'string');\n env = env || global_env;\n string = string.valueOf();\n this._with_parser = this._with_init_parser.bind(this, () => {\n if (!this.__parser__) {\n this.__parser__ = new Parser(string, { env });\n }\n return this.__parser__;\n });\n read_only(this, '__type__', text_port);\n this._make_defaults();\n}\nInputStringPort.prototype.char_ready = function() {\n return true;\n};\nInputStringPort.prototype = Object.create(InputPort.prototype);\nInputStringPort.prototype.constructor = InputStringPort;\nInputStringPort.prototype.toString = function() {\n return `#`;\n};\n// -------------------------------------------------------------------------\nfunction InputByteVectorPort(bytevectors) {\n if (typeof this !== 'undefined' && !(this instanceof InputByteVectorPort) ||\n typeof this === 'undefined') {\n return new InputByteVectorPort(bytevectors);\n }\n typecheck('InputByteVectorPort', bytevectors, 'uint8array');\n read_only(this, '__vector__', bytevectors);\n read_only(this, '__type__', binary_port);\n var index = 0;\n Object.defineProperty(this, '__index__', {\n enumerable: true,\n get: function() {\n return index;\n },\n set: function(value) {\n typecheck('InputByteVectorPort::__index__', value, 'number');\n if (value instanceof LNumber) {\n value = value.valueOf();\n }\n if (typeof value === 'bigint') {\n value = Number(value);\n }\n if (Math.floor(value) !== value) {\n throw new Error('InputByteVectorPort::__index__ value is ' +\n 'not integer');\n }\n index = value;\n }\n });\n}\nInputByteVectorPort.prototype = Object.create(InputPort.prototype);\nInputByteVectorPort.prototype.constructor = InputByteVectorPort;\nInputByteVectorPort.prototype.toString = function() {\n return `#`;\n};\nInputByteVectorPort.prototype.close = function() {\n read_only(this, '__vector__', nil);\n ['read_u8', 'close', 'peek_u8', 'read_u8_vector'].forEach(name => {\n this[name] = function() {\n throw new Error('Input-binary-port: port is closed');\n };\n });\n this.char_ready = function() {\n return false;\n };\n};\nInputByteVectorPort.prototype.u8_ready = function() {\n return true;\n};\nInputByteVectorPort.prototype.peek_u8 = function() {\n if (this.__index__ >= this.__vector__.length) {\n return eof;\n }\n return this.__vector__[this.__index__];\n};\nInputByteVectorPort.prototype.skip = function() {\n if (this.__index__ <= this.__vector__.length) {\n ++this.__index__;\n }\n};\nInputByteVectorPort.prototype.read_u8 = function() {\n const byte = this.peek_u8();\n this.skip();\n return byte;\n};\nInputByteVectorPort.prototype.read_u8_vector = function(len) {\n if (typeof len === 'undefined') {\n len = this.__vector__.length;\n } else if (len > this.__index__ + this.__vector__.length) {\n len = this.__index__ + this.__vector__.length;\n }\n if (this.peek_u8() === eof) {\n return eof;\n }\n return this.__vector__.slice(this.__index__, len);\n};\n// -------------------------------------------------------------------------\nfunction OutputByteVectorPort() {\n if (typeof this !== 'undefined' && !(this instanceof OutputByteVectorPort) ||\n typeof this === 'undefined') {\n return new OutputByteVectorPort();\n }\n read_only(this, '__type__', binary_port);\n read_only(this, '_buffer', [], { hidden: true });\n this.write = function(x) {\n typecheck('write', x, ['number', 'uint8array']);\n if (LNumber.isNumber(x)) {\n this._buffer.push(x.valueOf());\n } else {\n this._buffer.push(...Array.from(x));\n }\n };\n Object.defineProperty(this, '__buffer__', {\n enumerable: true,\n get: function() {\n return Uint8Array.from(this._buffer);\n }\n });\n}\nOutputByteVectorPort.prototype = Object.create(OutputPort.prototype);\nOutputByteVectorPort.prototype.constructor = OutputByteVectorPort;\nOutputByteVectorPort.prototype.close = function() {\n OutputPort.prototype.close.call(this);\n read_only(this, '_buffer', null, { hidden: true });\n};\nOutputByteVectorPort.prototype._close_guard = function() {\n if (this._closed) {\n throw new Error('output-port: binary port is closed');\n }\n};\nOutputByteVectorPort.prototype.write_u8 = function(byte) {\n typecheck('OutputByteVectorPort::write_u8', byte, 'number');\n this.write(byte);\n};\nOutputByteVectorPort.prototype.write_u8_vector = function(vector) {\n typecheck('OutputByteVectorPort::write_u8_vector', vector, 'uint8array');\n this.write(vector);\n};\nOutputByteVectorPort.prototype.toString = function() {\n return '#';\n};\nOutputByteVectorPort.prototype.valueOf = function() {\n return this.__buffer__;\n};\n// -------------------------------------------------------------------------\nfunction InputFilePort(content, filename) {\n if (typeof this !== 'undefined' && !(this instanceof InputFilePort) ||\n typeof this === 'undefined') {\n return new InputFilePort(content, filename);\n }\n InputStringPort.call(this, content);\n typecheck('InputFilePort', filename, 'string');\n read_only(this, '__filename__', filename);\n}\nInputFilePort.prototype = Object.create(InputStringPort.prototype);\nInputFilePort.prototype.constructor = InputFilePort;\nInputFilePort.prototype.toString = function() {\n return `#`;\n};\n// -------------------------------------------------------------------------\nfunction InputBinaryFilePort(content, filename) {\n if (typeof this !== 'undefined' && !(this instanceof InputBinaryFilePort) ||\n typeof this === 'undefined') {\n return new InputBinaryFilePort(content, filename);\n }\n InputByteVectorPort.call(this, content);\n typecheck('InputBinaryFilePort', filename, 'string');\n read_only(this, '__filename__', filename);\n}\nInputBinaryFilePort.prototype = Object.create(InputByteVectorPort.prototype);\nInputBinaryFilePort.prototype.constructor = InputBinaryFilePort;\nInputBinaryFilePort.prototype.toString = function() {\n return `#`;\n};\n// -------------------------------------------------------------------------\nfunction OutputBinaryFilePort(filename, fd) {\n if (typeof this !== 'undefined' && !(this instanceof OutputBinaryFilePort) ||\n typeof this === 'undefined') {\n return new OutputBinaryFilePort(filename, fd);\n }\n typecheck('OutputBinaryFilePort', filename, 'string');\n read_only(this, '__filename__', filename);\n read_only(this, '_fd', fd.valueOf(), { hidden: true });\n read_only(this, '__type__', binary_port);\n var fs, Buffer;\n this.write = function(x) {\n typecheck('write', x, ['number', 'uint8array']);\n var buffer;\n if (!fs) {\n fs = this.internal('fs');\n }\n if (!Buffer) {\n Buffer = this.internal('Buffer');\n }\n if (LNumber.isNumber(x)) {\n buffer = Buffer.from([x.valueOf()]);\n } else {\n buffer = Buffer.from(Array.from(x));\n }\n return new Promise((resolve, reject) => {\n fs.write(this._fd, buffer, function(err) {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n });\n };\n}\nOutputBinaryFilePort.prototype = Object.create(OutputFilePort.prototype);\nOutputBinaryFilePort.prototype.constructor = OutputBinaryFilePort;\nOutputBinaryFilePort.prototype.write_u8 = function(byte) {\n typecheck('OutputByteVectorPort::write_u8', byte, 'number');\n this.write(byte);\n};\nOutputBinaryFilePort.prototype.write_u8_vector = function(vector) {\n typecheck('OutputByteVectorPort::write_u8_vector', vector, 'uint8array');\n this.write(vector);\n};\n// -------------------------------------------------------------------------\nconst binary_port = Symbol.for('binary');\nconst text_port = Symbol.for('text');\nvar eof = new EOF();\nfunction EOF() {}\nEOF.prototype.toString = function() {\n return '#';\n};\n// -------------------------------------------------------------------------\n// simpler way to create interpreter with interaction-environment\n// -------------------------------------------------------------------------\nfunction Interpreter(name, { stderr, stdin, stdout, ...obj } = {}) {\n if (typeof this !== 'undefined' && !(this instanceof Interpreter) ||\n typeof this === 'undefined') {\n return new Interpreter(name, { stdin, stdout, stderr, ...obj });\n }\n if (typeof name === 'undefined') {\n name = 'anonymous';\n }\n this.__env__ = user_env.inherit(name, obj);\n this.__env__.set('parent.frame', doc('parent.frame', () => {\n return this.__env__;\n }, global_env.__env__['parent.frame'].__doc__));\n const defaults_name = '**interaction-environment-defaults**';\n this.set(defaults_name, get_props(obj).concat(defaults_name));\n var inter = internal_env.inherit(`internal-${name}`);\n if (is_port(stdin)) {\n inter.set('stdin', stdin);\n }\n if (is_port(stderr)) {\n inter.set('stderr', stderr);\n }\n if (is_port(stdout)) {\n inter.set('stdout', stdout);\n }\n set_interaction_env(this.__env__, inter);\n}\n// -------------------------------------------------------------------------\nInterpreter.prototype.exec = function(code, dynamic = false, env = null) {\n typecheck('Interpreter::exec', code, ['string', 'array'], 1);\n typecheck('Interpreter::exec', dynamic, 'boolean', 2);\n // simple solution to overwrite this variable in each interpreter\n // before evaluation of user code\n global_env.set('**interaction-environment**', this.__env__);\n if (env === null) {\n env = this.__env__;\n }\n return exec(code, env, dynamic ? env : false);\n};\n// -------------------------------------------------------------------------\nInterpreter.prototype.get = function(value) {\n const result = this.__env__.get(value);\n if (is_function(result)) {\n return result.bind(this.__env__);\n }\n return result;\n};\n// -------------------------------------------------------------------------\nInterpreter.prototype.set = function(name, value) {\n return this.__env__.set(name, value);\n};\n// -------------------------------------------------------------------------\nInterpreter.prototype.constant = function(name, value) {\n return this.__env__.constant(name, value);\n};\n// -------------------------------------------------------------------------\n// Lips Exception used in error function\n// -------------------------------------------------------------------------\nfunction LipsError(message, args) {\n this.name = 'LipsError';\n this.message = message;\n this.args = args;\n this.stack = (new Error()).stack;\n}\nLipsError.prototype = new Error();\nLipsError.prototype.constructor = LipsError;\n// -------------------------------------------------------------------------\n// :: Environment constructor (parent and name arguments are optional)\n// -------------------------------------------------------------------------\nfunction Environment(obj, parent, name) {\n if (arguments.length === 1) {\n if (typeof arguments[0] === 'object') {\n obj = arguments[0];\n parent = null;\n } else if (typeof arguments[0] === 'string') {\n obj = {};\n parent = null;\n name = arguments[0];\n }\n }\n this.__docs__ = new Map();\n this.__env__ = obj;\n this.__parent__ = parent;\n this.__name__ = name || 'anonymous';\n}\n// -------------------------------------------------------------------------\nEnvironment.prototype.list = function() {\n return get_props(this.__env__);\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.fs = function() {\n return this.get('**fs**');\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.unset = function(name) {\n if (name instanceof LSymbol) {\n name = name.valueOf();\n }\n if (name instanceof LString) {\n name = name.valueOf();\n }\n delete this.__env__[name];\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.inherit = function(name, obj = {}) {\n if (typeof name === \"object\") {\n obj = name;\n }\n if (!name || typeof name === \"object\") {\n name = 'child of ' + (this.__name__ || 'unknown');\n }\n return new Environment(obj || {}, this, name);\n};\n// -------------------------------------------------------------------------\n// :: lookup function for variable doc strings\n// -------------------------------------------------------------------------\nEnvironment.prototype.doc = function(name, value = null, dump = false) {\n if (name instanceof LSymbol) {\n name = name.__name__;\n }\n if (name instanceof LString) {\n name = name.valueOf();\n }\n if (value) {\n if (!dump) {\n value = trim_lines(value);\n }\n this.__docs__.set(name, value);\n return this;\n }\n if (this.__docs__.has(name)) {\n return this.__docs__.get(name);\n }\n if (this.__parent__) {\n return this.__parent__.doc(name);\n }\n};\n// -------------------------------------------------------------------------\n// :: function create frame environment for usage in functions\n// :: frames are used to it's easier to find environments of the functions\n// :: in scope chain, they are dummy environments just for lookup\n// -------------------------------------------------------------------------\nEnvironment.prototype.newFrame = function(fn, args) {\n var frame = this.inherit('__frame__');\n frame.set('parent.frame', doc('parent.frame', function(n = 1) {\n n = n.valueOf();\n var scope = frame.__parent__;\n if (!(scope instanceof Environment)) {\n return nil;\n }\n if (n <= 0) {\n return scope;\n }\n var parent_frame = scope.get('parent.frame');\n return parent_frame(n - 1);\n }, global_env.__env__['parent.frame'].__doc__));\n args.callee = fn;\n frame.set('arguments', args);\n return frame;\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype._lookup = function(symbol) {\n if (symbol instanceof LSymbol) {\n symbol = symbol.__name__;\n }\n if (symbol instanceof LString) {\n symbol = symbol.valueOf();\n }\n if (this.__env__.hasOwnProperty(symbol)) {\n return Value(this.__env__[symbol]);\n }\n if (this.__parent__) {\n return this.__parent__._lookup(symbol);\n }\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.toString = function() {\n return '#';\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.clone = function() {\n // duplicate refs\n var env = {};\n // TODO: duplicated Symbols\n Object.keys(this.__env__).forEach(key => {\n env[key] = this.__env__[key];\n });\n return new Environment(env, this.__parent__, this.__name__);\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.merge = function(env, name = 'merge') {\n typecheck('Environment::merge', env, 'environment');\n return this.inherit(name, env.__env__);\n};\n// -------------------------------------------------------------------------\n// value returned in lookup if found value in env and in promise_all\n// -------------------------------------------------------------------------\nfunction Value(value) {\n if (typeof this !== 'undefined' && !(this instanceof Value) ||\n typeof this === 'undefined') {\n return new Value(value);\n }\n this.value = value;\n}\n// -------------------------------------------------------------------------\nValue.isUndefined = function(x) {\n return x instanceof Value && typeof x.value === 'undefined';\n};\n// -------------------------------------------------------------------------\nValue.prototype.valueOf = function() {\n return this.value;\n};\n// -------------------------------------------------------------------------\n// :: different object than value used as object for (values)\n// -------------------------------------------------------------------------\nfunction Values(values) {\n if (values.length) {\n if (values.length === 1) {\n return values[0];\n }\n }\n if (typeof this !== 'undefined' && !(this instanceof Values) ||\n typeof this === 'undefined') {\n return new Values(values);\n }\n this.__values__ = values;\n}\nValues.prototype.toString = function() {\n return this.__values__.map(x => toString(x)).join('\\n');\n};\nValues.prototype.valueOf = function() {\n return this.__values__;\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.get = function(symbol, options = {}) {\n // we keep original environment as context for bind\n // so print will get user stdout\n typecheck('Environment::get', symbol, ['symbol', 'string']);\n const { throwError = true } = options;\n var name = symbol;\n if (name instanceof LSymbol || name instanceof LString) {\n name = name.valueOf();\n }\n var value = this._lookup(name);\n if (value instanceof Value) {\n if (Value.isUndefined(value)) {\n return undefined;\n }\n return patch_value(value.valueOf());\n }\n var parts;\n if (symbol instanceof LSymbol && symbol[LSymbol.object]) {\n // dot notation symbols from syntax-rules that are gensyms\n parts = symbol[LSymbol.object];\n } else if (typeof name === 'string') {\n parts = name.split('.').filter(Boolean);\n }\n if (parts && parts.length > 0) {\n var [first, ...rest] = parts;\n value = this._lookup(first);\n if (rest.length) {\n try {\n if (value instanceof Value) {\n value = value.valueOf();\n } else {\n value = get(root, first);\n if (is_function(value)) {\n value = unbind(value);\n }\n }\n if (typeof value !== 'undefined') {\n // object accessor\n return get(value, ...rest);\n }\n } catch (e) {\n throw e;\n }\n } else if (value instanceof Value) {\n return patch_value(value.valueOf());\n }\n value = get(root, name);\n }\n if (typeof value !== 'undefined') {\n return value;\n }\n if (throwError) {\n throw new Error(\"Unbound variable `\" + name.toString() + \"'\");\n }\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.set = function(name, value, doc = null) {\n typecheck('Environment::set', name, ['string', 'symbol']);\n if (LNumber.isNumber(value)) {\n value = LNumber(value);\n }\n if (name instanceof LSymbol) {\n name = name.__name__;\n }\n if (name instanceof LString) {\n name = name.valueOf();\n }\n this.__env__[name] = value;\n if (doc) {\n this.doc(name, doc, true);\n }\n return this;\n};\n// -------------------------------------------------------------------------\n// for internal use only\n// -------------------------------------------------------------------------\nEnvironment.prototype.constant = function(name, value) {\n if (this.__env__.hasOwnProperty(name)) {\n throw new Error(`Environment::constant: ${name} already exists`);\n }\n if (arguments.length === 1 && is_plain_object(arguments[0])) {\n var obj = arguments[0];\n Object.keys(obj).forEach(key => {\n this.constant(name, obj[key]);\n });\n } else {\n Object.defineProperty(this.__env__, name, {\n value,\n enumerable: true\n });\n }\n return this;\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.has = function(name) {\n return this.__env__.hasOwnProperty(name);\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.ref = function(name) {\n var env = this;\n while (true) {\n if (!env) {\n break;\n }\n if (env.has(name)) {\n return env;\n }\n env = env.__parent__;\n }\n};\n// -------------------------------------------------------------------------\nEnvironment.prototype.parents = function() {\n var env = this;\n var result = [];\n while (env) {\n result.unshift(env);\n env = env.__parent__;\n }\n return result;\n};\n// -------------------------------------------------------------------------\n// :: Quote function used to pause evaluation from Macro\n// -------------------------------------------------------------------------\nfunction quote(value) {\n if (is_promise(value)) {\n return value.then(quote);\n }\n if (value instanceof Pair || value instanceof LSymbol) {\n value[__data__] = true;\n }\n return value;\n}\n// -------------------------------------------------------------------------\n// :: Unquote is used for multiple backticks and unquote\n// -------------------------------------------------------------------------\nfunction Unquote(value, count, max) {\n this.value = value;\n this.count = count;\n this.max = max;\n}\nUnquote.prototype.toString = function() {\n return '#';\n};\n// -------------------------------------------------------------------------------\nvar native_lambda = parse(tokenize(`(lambda ()\n \"[native code]\"\n (throw \"Invalid Invocation\"))`))[0];\n// -------------------------------------------------------------------------------\nvar get = doc('get', function get(object, ...args) {\n var value;\n var len = args.length;\n while (args.length) {\n // if arg is symbol someone probably want to get __fn__ from binded function\n if (is_function(object) && typeof args[0] !== 'symbol') {\n object = unbind(object);\n }\n var arg = args.shift();\n var name = unbox(arg);\n // the value was set to false to prevent resolving\n // by Real Promises #153\n if (name === 'then' && object instanceof QuotedPromise) {\n value = QuotedPromise.prototype.then;\n } else if (name === '__code__' && is_function(object) &&\n typeof object.__code__ === 'undefined') {\n value = native_lambda;\n } else {\n value = object[name];\n }\n if (typeof value === 'undefined') {\n if (args.length) {\n throw new Error(`Try to get ${args[0]} from undefined`);\n }\n return value;\n } else {\n var context;\n if (args.length - 1 < len) {\n context = object;\n }\n value = patch_value(value, context);\n }\n object = value;\n }\n return value;\n}, `(. obj . args)\n (get obj . args)\n\n Function use object as base and keep using arguments to get the\n property of JavaScript object. Arguments need to be a strings.\n e.g. \\`(. console \"log\")\\` if you use any function inside LIPS is\n will be weakly bind (can be rebind), so you can call this log function\n without problem unlike in JavaScript when you use\n \\`var log = console.log\\`.\n \\`get\\` is an alias because . don't work in every place, e.g. you can't\n pass it as argument.`);\n// -------------------------------------------------------------------------\n// function get internal protected data\n// -------------------------------------------------------------------------\nfunction internal(env, name) {\n var internal_env = interaction(env, '**internal-env**');\n return internal_env.get(name);\n}\n// -------------------------------------------------------------------------\n// get variable from interaction environment\n// -------------------------------------------------------------------------\nfunction interaction(env, name) {\n var interaction_env = env.get('**interaction-environment**');\n return interaction_env.get(name);\n}\n// -------------------------------------------------------------------------\nvar internal_env = new Environment({\n stdout: new BufferedOutputPort(function(...args) {\n console.log(...args);\n }),\n // ------------------------------------------------------------------\n stderr: new BufferedOutputPort(function(...args) {\n console.error(...args);\n }),\n // ------------------------------------------------------------------\n stdin: InputPort(function() {\n return Promise.resolve(prompt(''));\n }),\n // those will be compiled by babel regex plugin\n 'letter-unicode-regex': /\\p{L}/u,\n 'numeral-unicode-regex': /\\p{N}/u,\n 'space-unicode-regex': /\\s/u\n}, undefined, 'internal');\n// -------------------------------------------------------------------------\nvar nan = LNumber(NaN);\nvar constants = {\n 'true': true,\n 'false': false,\n '#true': true,\n '#false': false,\n '#t': true,\n '#f': false,\n nil,\n 'undefined': undefined,\n 'null': null,\n 'NaN': nan,\n '+nan.0': nan,\n '-nan.0': nan\n};\n// -------------------------------------------------------------------------\nvar global_env = new Environment({\n eof,\n undefined, // undefined as parser constant breaks most of the unit tests\n // ---------------------------------------------------------------------\n 'peek-char': doc('peek-char', function(port = null) {\n if (port === null) {\n port = internal(this, 'stdin');\n }\n typecheck_text_port('peek-char', port, 'input-port');\n return port.peek_char();\n }, `(peek-char port)\n\n Function get character from string port or EOF object if no more\n data in string port.`),\n // ------------------------------------------------------------------\n 'read-line': doc('read-line', function(port = null) {\n if (port === null) {\n port = internal(this, 'stdin');\n }\n typecheck_text_port('read-line', port, 'input-port');\n return port.read_line();\n }, `(read-char port)\n\n Function read next character from input port.`),\n // ------------------------------------------------------------------\n 'read-char': doc('read-char', function(port = null) {\n if (port === null) {\n port = internal(this, 'stdin');\n }\n typecheck_text_port('read-char', port, 'input-port');\n return port.read_char();\n }, `(read-char port)\n\n Function read next character from input port.`),\n // ------------------------------------------------------------------\n read: doc('read', async function read(arg = null) {\n if (LString.isString(arg)) {\n for await (let value of parse(arg, this)) {\n return value;\n }\n }\n var port;\n if (arg === null) {\n port = internal(this, 'stdin');\n } else {\n port = arg;\n }\n typecheck_text_port('read', port, 'input-port');\n return port.read.call(this);\n }, `(read [string])\n\n Function if used with string will parse the string and return\n list structure of LIPS code. If called without an argument it\n will read string from standard input (using browser prompt or\n user defined way) and call itself with that string (parse is)\n function can be used together with eval to evaluate code from\n string`),\n // ------------------------------------------------------------------\n pprint: doc('pprint', function pprint(arg) {\n if (arg instanceof Pair) {\n arg = new lips.Formatter(arg.toString(true)).break().format();\n global_env.get('display').call(global_env, arg);\n } else {\n global_env.get('write').call(global_env, arg);\n }\n global_env.get('newline').call(global_env);\n }, `(pprint expression)\n\n Pretty print list expression, if called with non-pair it just call\n print function with passed argument.`),\n // ------------------------------------------------------------------\n print: doc('print', function print(...args) {\n const display = global_env.get('display');\n const newline = global_env.get('newline');\n args.forEach(arg => {\n display.call(global_env, arg);\n newline.call(global_env);\n });\n }, `(print . args)\n\n Function convert each argument to string and print the result to\n standard output (by default it's console but it can be defined\n it user code), the function call newline after printing each arg.`),\n // ------------------------------------------------------------------\n format: doc('format', function format(str, ...args) {\n typecheck('format', str, 'string');\n const re = /(~[as%~])/g;\n let m = str.match(/(~[as])/g);\n if (m && m.length > args.length) {\n throw new Error('Not enough arguments');\n }\n var i = 0;\n var repr = global_env.get('repr');\n str = str.replace(re, (x) => {\n const chr = x[1];\n if (chr === '~') {\n return '~';\n } else if (chr === '%') {\n return '\\n';\n } else {\n const arg = args[i++];\n if (chr === 'a') {\n return repr(arg);\n } else {\n return repr(arg, true);\n }\n }\n });\n m = str.match(/~([\\S])/);\n if (m) {\n throw new Error(`format: Unrecognized escape sequence ${m[1]}`);\n }\n return str;\n }, `(format string n1 n2 ...)\n\n Function accepts string template and replacing any escape sequences\n by arguments:\n\n * ~a value as if printed with display\n * ~s value as if printed with write\n * ~% newline character\n * ~~ literal tilde '~' is inserted\n\n if there missing arguments or other escape character it throw exception.`),\n // ------------------------------------------------------------------\n display: doc('display', function display(arg, port = null) {\n if (port === null) {\n port = internal(this, 'stdout');\n } else {\n typecheck('display', port, 'output-port');\n }\n const value = global_env.get('repr')(arg);\n port.write.call(global_env, value);\n }, `(display arg [port])\n\n Function send string to standard output or provied port.`),\n // ------------------------------------------------------------------\n 'display-error': doc('display-error', function error(...args) {\n const port = internal(this, 'stderr');\n const repr = global_env.get('repr');\n const value = args.map(repr).join(' ');\n port.write.call(global_env, value);\n global_env.get('newline')(port);\n }, `(display-error . args)\n\n Display error message.`),\n // ------------------------------------------------------------------\n '%same-functions': doc('%same-functions', function(a, b) {\n if (!is_function(a)) {\n return false;\n }\n if (!is_function(b)) {\n return false;\n }\n return unbind(a) === unbind(b);\n }, `(%same-functions a b)\n\n Helper function that check if two bound functions are the same`),\n // ------------------------------------------------------------------\n help: doc(new Macro('help', function(code, { dynamic_scope, error }) {\n var symbol;\n if (code.car instanceof LSymbol) {\n symbol = code.car;\n } else if (code.car instanceof Pair && code.car.car instanceof LSymbol) {\n symbol = code.car.car;\n } else {\n var env = this;\n if (dynamic_scope) {\n dynamic_scope = this;\n }\n var ret = evaluate(code.car, { env, error, dynamic_scope });\n if (ret && ret.__doc__) {\n return ret.__doc__;\n }\n return;\n }\n var __doc__;\n var value = this.get(symbol);\n __doc__ = value && value.__doc__;\n if (__doc__) {\n return __doc__;\n }\n var ref = this.ref(symbol);\n if (ref) {\n __doc__ = ref.doc(symbol);\n if (__doc__) {\n return __doc__;\n }\n }\n }), `(help object)\n\n Macro returns documentation for function or macro. You can save the function\n or macro in variable and use it in context. But help for variable require\n to pass the symbol itself.`),\n // ------------------------------------------------------------------\n cons: doc('cons', function cons(car, cdr) {\n return new Pair(car, cdr);\n }, `(cons left right)\n\n Function return new Pair out of two arguments.`),\n // ------------------------------------------------------------------\n car: doc('car', function car(list) {\n typecheck('car', list, 'pair');\n return list.car;\n }, `(car pair)\n\n Function returns car (head) of the list/pair.`),\n // ------------------------------------------------------------------\n cdr: doc('cdr', function cdr(list) {\n typecheck('cdr', list, 'pair');\n return list.cdr;\n }, `(cdr pair)\n\n Function returns cdr (tail) of the list/pair.`),\n // ------------------------------------------------------------------\n 'set!': doc(new Macro('set!', function(code, { dynamic_scope, error } = {}) {\n if (dynamic_scope) {\n dynamic_scope = this;\n }\n var env = this;\n var ref;\n var value = evaluate(code.cdr.car, { env: this, dynamic_scope, error });\n value = resolve_promises(value);\n function set(object, key, value) {\n if (is_promise(object)) {\n return object.then(key => set(object, key, value));\n }\n if (is_promise(key)) {\n return key.then(key => set(object, key, value));\n }\n if (is_promise(value)) {\n return value.then(value => set(object, key, value));\n }\n env.get('set-obj!').call(env, object, key, value);\n return value;\n }\n if (code.car instanceof Pair && LSymbol.is(code.car.car, '.')) {\n var second = code.car.cdr.car;\n var third = code.car.cdr.cdr.car;\n var object = evaluate(second, { env: this, dynamic_scope, error });\n var key = evaluate(third, { env: this, dynamic_scope, error });\n return set(object, key, value);\n }\n if (!(code.car instanceof LSymbol)) {\n throw new Error('set! first argument need to be a symbol or ' +\n 'dot accessor that evaluate to object.');\n }\n var symbol = code.car.valueOf();\n ref = this.ref(code.car.__name__);\n // we don't return value because we only care about sync of set value\n // when value is a promise\n return unpromise(value, value => {\n if (!ref) {\n // case (set! fn.toString (lambda () \"xxx\"))\n var parts = symbol.split('.');\n if (parts.length > 1) {\n var key = parts.pop();\n var name = parts.join('.');\n var obj = this.get(name, { throwError: false });\n if (obj) {\n set(obj, key, value);\n return;\n }\n }\n throw new Error('Unbound variable `' + symbol + '\\'');\n }\n ref.set(symbol, value);\n });\n }), `(set! name value)\n\n Macro that can be used to set the value of the variable (mutate)\n it search the scope chain until it finds first non empty slot and set it.`),\n // ------------------------------------------------------------------\n 'unset!': doc(new Macro('set!', function(code) {\n if (!(code.car instanceof LSymbol)) {\n throw new Error('unset! first argument need to be a symbol or ' +\n 'dot accessor that evaluate to object.');\n }\n const symbol = code.car;\n var ref = this.ref(symbol);\n if (ref) {\n delete ref.__env__[symbol.__name__];\n }\n }), `(unset! name)\n\n Function delete specified name from environment.`),\n // ------------------------------------------------------------------\n 'set-car!': doc('set-car!', function(slot, value) {\n typecheck('set-car!', slot, 'pair');\n slot.car = value;\n }, `(set-car! obj value)\n\n Function that set car (head) of the list/pair to specified value.\n It can destroy the list. Old value is lost.`),\n // ------------------------------------------------------------------\n 'set-cdr!': doc('set-cdr!', function(slot, value) {\n typecheck('set-cdr!', slot, 'pair');\n slot.cdr = value;\n }, `(set-cdr! obj value)\n\n Function that set cdr (tail) of the list/pair to specified value.\n It can destroy the list. Old value is lost.`),\n // ------------------------------------------------------------------\n 'empty?': doc('empty?', function(x) {\n return typeof x === 'undefined' || x === nil;\n }, `(empty? object)\n\n Function return true if value is undefined empty list.`),\n // ------------------------------------------------------------------\n gensym: doc(\n 'gensym',\n gensym,\n `(gensym)\n\n Function generate unique symbol, to use with macros as meta name.`),\n // ------------------------------------------------------------------\n // TODO: (load filename environment-specifier)\n // ------------------------------------------------------------------\n load: doc('load', function load(file, env) {\n typecheck('load', file, 'string');\n var g_env = this;\n if (g_env.__name__ === '__frame__') {\n g_env = g_env.__parent__;\n }\n if (!(env instanceof Environment)) {\n if (g_env === global_env) {\n // this is used for let-env + load\n // this may be obsolete when there is env arg\n env = g_env;\n } else {\n env = this.get('**interaction-environment**');\n }\n }\n const PATH = '**module-path**';\n var module_path = global_env.get(PATH, { throwError: false });\n file = file.valueOf();\n if (!file.match(/.[^.]+$/)) {\n file += '.scm';\n }\n const IS_BIN = file.match(/\\.xcb$/);\n function run(code) {\n if (IS_BIN) {\n code = unserialize_bin(code);\n } else {\n if (type(code) === 'buffer') {\n code = code.toString();\n }\n code = code.replace(/^#!.*/, '');\n if (code.match(/^\\{/)) {\n code = unserialize(code);\n }\n }\n return exec(code, env);\n }\n function fetch(file) {\n return root.fetch(file)\n .then(res => IS_BIN ? res.arrayBuffer() : res.text())\n .then((code) => {\n if (IS_BIN) {\n code = new Uint8Array(code);\n }\n return code;\n });\n }\n if (is_node()) {\n return new Promise((resolve, reject) => {\n var path = nodeRequire('path');\n if (module_path) {\n module_path = module_path.valueOf();\n file = path.join(module_path, file);\n }\n global_env.set(PATH, path.dirname(file));\n nodeRequire('fs').readFile(file, function(err, data) {\n if (err) {\n reject(err);\n global_env.set(PATH, module_path);\n } else {\n try {\n run(data).then(() => {\n resolve();\n global_env.set(PATH, module_path);\n }).catch(reject);\n } catch (e) {\n reject(e);\n }\n }\n });\n });\n }\n if (module_path) {\n module_path = module_path.valueOf();\n file = module_path + '/' + file.replace(/^\\.?\\/?/, '');\n }\n return fetch(file).then(code => {\n global_env.set(PATH, file.replace(/\\/[^/]*$/, ''));\n return run(code);\n }).then(() => {}).finally(() => {\n global_env.set(PATH, module_path);\n });\n }, `(load filename)\n (load filename environment)\n\n Function fetch the file and evaluate its content as LIPS code,\n If second argument is provided and it's environment the evaluation\n will happen in that environment.`),\n // ------------------------------------------------------------------\n 'do': doc(new Macro('do', async function(code, { dynamic_scope, error }) {\n var self = this;\n if (dynamic_scope) {\n dynamic_scope = self;\n }\n var scope = self.inherit('do');\n var vars = code.car;\n var test = code.cdr.car;\n var body = code.cdr.cdr;\n if (body !== nil) {\n body = new Pair(LSymbol('begin'), body);\n }\n let eval_args = { env: self, dynamic_scope, error };\n let node = vars;\n while (node !== nil) {\n const item = node.car;\n scope.set(item.car, await evaluate(item.cdr.car, eval_args));\n node = node.cdr;\n }\n eval_args = { env: scope, dynamic_scope, error };\n while ((await evaluate(test.car, eval_args)) === false) {\n if (body !== nil) {\n await lips.evaluate(body, eval_args);\n }\n let node = vars;\n const next = {};\n while (node !== nil) {\n const item = node.car;\n if (item.cdr.cdr !== nil) {\n const value = await evaluate(item.cdr.cdr.car, eval_args);\n next[item.car.valueOf()] = value;\n }\n node = node.cdr;\n }\n const symbols = Object.getOwnPropertySymbols(next);\n Object.keys(next).concat(symbols).forEach(key => {\n scope.set(key, next[key]);\n });\n }\n if (test.cdr !== nil) {\n return await evaluate(test.cdr.car, eval_args);\n }\n }), `(do (( )) (test expression) . body)\n\n Iteration macro that evaluate the expression body in scope of the variables.\n On Eeach loop it increase the variables according to next expression and run\n test to check if the loop should continue. If test is signle call the macro\n will not return anything. If the test is pair of expression and value the\n macro will return that value after finish.`),\n // ------------------------------------------------------------------\n 'if': doc(new Macro('if', function(code, { dynamic_scope, error }) {\n if (dynamic_scope) {\n dynamic_scope = this;\n }\n var env = this;\n var resolve = (cond) => {\n if (cond === false) {\n return evaluate(code.cdr.cdr.car, {\n env,\n dynamic_scope,\n error\n });\n } else {\n return evaluate(code.cdr.car, {\n env,\n dynamic_scope,\n error\n });\n }\n };\n if (code === nil) {\n throw new Error('too few expressions for `if`');\n }\n var cond = evaluate(code.car, { env, dynamic_scope, error });\n return unpromise(cond, resolve);\n }), `(if cond true-expr false-expr)\n\n Macro evaluate condition expression and if the value is true, it\n evaluate and return true expression if not it evaluate and return\n false expression`),\n // ------------------------------------------------------------------\n 'let-env': new Macro('let-env', function(code, options = {}) {\n const { dynamic_scope, error } = options;\n typecheck('let-env', code, 'pair');\n var ret = evaluate(code.car, { env: this, dynamic_scope, error });\n return unpromise(ret, function(value) {\n typecheck('let-env', value, 'environment');\n return evaluate(Pair(LSymbol('begin'), code.cdr), {\n env: value, dynamic_scope, error\n });\n });\n }, `(let-env env . body)\n\n Special macro that evaluate body in context of given environment\n object.`),\n // ------------------------------------------------------------------\n 'letrec': doc(\n let_macro(Symbol.for('letrec')),\n `(letrec ((a value-a) (b value-b)) body)\n\n Macro that creates new environment, then evaluate and assign values to\n names and then evaluate the body in context of that environment.\n Values are evaluated sequentially and next value can access to\n previous values/names.`),\n // ---------------------------------------------------------------------\n 'letrec*': doc(\n let_macro(Symbol.for('letrec')),\n `(letrec* ((a value-a) (b value-b)) body)\n\n Same as letrec but the order of execution of the binding is guaranteed,\n so use can use recursive code as well as reference previous binding.\n In LIPS both letrec and letrec* behave the same.`),\n // ---------------------------------------------------------------------\n 'let*': doc(\n let_macro(Symbol.for('let*')),\n `(let* ((a value-a) (b value-b)) body)\n\n Macro similar to \\`let\\` but next argument get environment\n from previous let variable, so they you can define one variable,\n and use in next argument.`),\n // ---------------------------------------------------------------------\n 'let': doc(\n let_macro(Symbol.for('let')),\n `(let ((a value-a) (b value-b)) body)\n\n Macro that creates new environment, then evaluate and assign values to\n names and then evaluate the body in context of that environment.\n Values are evaluated sequentially but you can't access\n previous values/names when next are evaluated. You can only get them\n from body of let expression.`),\n // ------------------------------------------------------------------\n 'begin*': doc(pararel('begin*', function(values) {\n return values.pop();\n }), `(begin* . expr)\n\n This macro is parallel version of begin. It evaluate each expression and\n if it's a promise it will evaluate it in parallel and return value\n of last expression.`),\n // ------------------------------------------------------------------\n 'begin': doc(new Macro('begin', function(code, options) {\n var args = Object.assign({ }, options);\n var arr = global_env.get('list->array')(code);\n if (args.dynamic_scope) {\n args.dynamic_scope = this;\n }\n args.env = this;\n var result;\n return (function loop() {\n if (arr.length) {\n var code = arr.shift();\n var ret = evaluate(code, args);\n return unpromise(ret, value => {\n result = value;\n return loop();\n });\n } else {\n return result;\n }\n })();\n }), `(begin . args)\n\n Macro runs list of expression and return valuate of the list one.\n It can be used in place where you can only have single expression,\n like if expression.`),\n // ------------------------------------------------------------------\n 'ignore': new Macro('ignore', function(code, { dynamic_scope, error }) {\n var args = { env: this, error };\n if (dynamic_scope) {\n args.dynamic_scope = this;\n }\n evaluate(new Pair(new LSymbol('begin'), code), args);\n }, `(ignore expression)\n\n Macro that will evaluate expression and swallow any promises that may\n be created. It wil run and ignore any value that may be returned by\n expression. The code should have side effects and/or when it's promise\n it should resolve to undefined.`),\n // ------------------------------------------------------------------\n 'call/cc': doc(Macro.defmacro('call/cc', function(code, eval_args = {}) {\n const args = {\n env: this,\n ...eval_args\n };\n return unpromise(evaluate(code.car, args), (result) => {\n if (is_function(result)) {\n return result(new Continuation(null));\n }\n });\n }), `(call/cc proc)\n\n TODO`),\n // ------------------------------------------------------------------\n define: doc(Macro.defmacro('define', function(code, eval_args) {\n var env = this;\n if (code.car instanceof Pair &&\n code.car.car instanceof LSymbol) {\n var new_code = new Pair(\n new LSymbol(\"define\"),\n new Pair(\n code.car.car,\n new Pair(\n new Pair(\n new LSymbol(\"lambda\"),\n new Pair(\n code.car.cdr,\n code.cdr\n )\n )\n )\n )\n );\n return new_code;\n } else if (eval_args.macro_expand) {\n // prevent evaluation in macroexpand\n return;\n }\n if (eval_args.dynamic_scope) {\n eval_args.dynamic_scope = this;\n }\n eval_args.env = env;\n var value = code.cdr.car;\n let new_expr;\n if (value instanceof Pair) {\n value = evaluate(value, eval_args);\n new_expr = true;\n } else if (value instanceof LSymbol) {\n value = env.get(value);\n }\n typecheck('define', code.car, 'symbol');\n return unpromise(value, value => {\n if (env.__name__ === Syntax.__merge_env__) {\n env = env.__parent__;\n }\n if (new_expr &&\n ((is_function(value) && is_lambda(value)) ||\n (value instanceof Syntax))) {\n value.__name__ = code.car.valueOf();\n if (value.__name__ instanceof LString) {\n value.__name__ = value.__name__.valueOf();\n }\n }\n let __doc__;\n if (code.cdr.cdr instanceof Pair &&\n LString.isString(code.cdr.cdr.car)) {\n __doc__ = code.cdr.cdr.car.valueOf();\n }\n env.set(code.car, value, __doc__, true);\n });\n }), `(define name expression)\n (define name expression \"doc string\")\n (define (function-name . args) body)\n\n Macro for defining values. It can be used to define variables,\n or function. If first argument is list it will create function\n with name beeing first element of the list. The macro evaluate\n code \\`(define function (lambda args body))\\``),\n // ------------------------------------------------------------------\n 'set-obj!': doc('set-obj!', function(obj, key, value) {\n var obj_type = typeof obj;\n if (is_null(obj) || (obj_type !== 'object' && obj_type !== 'function')) {\n var msg = typeErrorMessage('set-obj!', type(obj), ['object', 'function']);\n throw new Error(msg);\n }\n typecheck('set-obj!', key, ['string', 'symbol', 'number']);\n obj = unbind(obj);\n key = key.valueOf();\n if (arguments.length === 2) {\n delete obj[key];\n } else if (is_prototype(obj) && is_function(value)) {\n obj[key] = unbind(value);\n obj[key][__prototype__] = true;\n } else if (is_function(value) || is_native(value) || value === nil) {\n obj[key] = value;\n } else {\n obj[key] = value && !is_prototype(value) ? value.valueOf() : value;\n }\n }, `(set-obj! obj key value)\n\n Function set property of JavaScript object`),\n // ------------------------------------------------------------------\n 'null-environment': doc('null-environment', function() {\n return global_env.inherit('null');\n }, `(null-environment)\n\n Function return new base environment with std lib.`),\n // ------------------------------------------------------------------\n 'values': doc('values', function values(...args) {\n return Values(args);\n }, `(values a1 a2 ...)\n\n If called with more then one element it will create special\n Values object that can be used in call-with-values function`),\n // ------------------------------------------------------------------\n 'call-with-values': doc('call-with-values', function(producer, consumer) {\n typecheck('call-with-values', producer, 'function', 1);\n typecheck('call-with-values', consumer, 'function', 2);\n var maybe = producer();\n if (maybe instanceof Values) {\n return consumer(...maybe.valueOf());\n }\n return consumer(maybe);\n }, `(call-with-values producer consumer)\n\n Calls its producer argument with no values and a continuation that,\n when passed some values, calls the consumer procedure with those\n values as arguments.`),\n // ------------------------------------------------------------------\n 'current-environment': doc('current-environment', function() {\n if (this.__name__ === '__frame__') {\n return this.__parent__;\n }\n return this;\n }, `(current-environment)\n\n Function return current environment.`),\n // ------------------------------------------------------------------\n 'parent.frame': doc('parent.frame', function() {\n return user_env;\n }, `(parent.frame)\n\n Return parent environment if called from inside function.\n If no parent frame found it return nil.`),\n // ------------------------------------------------------------------\n 'eval': doc('eval', function(code, env) {\n env = env || this.get('current-environment').call(this);\n return evaluate(code, {\n env,\n //dynamic_scope: this,\n error: e => {\n var error = global_env.get('display-error');\n error.call(this, e.message);\n if (e.code) {\n var stack = e.code.map((line, i) => {\n return `[${i + 1}]: ${line}`;\n }).join('\\n');\n error.call(this, stack);\n }\n }\n });\n }, `(eval expr)\n (eval expr environment)\n\n Function evaluate LIPS Scheme code.`),\n // ------------------------------------------------------------------\n lambda: new Macro('lambda', function(code, { dynamic_scope, error } = {}) {\n var self = this;\n var __doc__;\n if (code.cdr instanceof Pair &&\n LString.isString(code.cdr.car) &&\n code.cdr.cdr !== nil) {\n __doc__ = code.cdr.car.valueOf();\n }\n function lambda(...args) {\n var env;\n // this is function calling env\n // self is lexical scope when function was defined\n if (dynamic_scope) {\n if (!(this instanceof Environment)) {\n env = self;\n } else {\n env = this;\n }\n } else {\n env = self;\n }\n env = env.inherit('lambda');\n var name = code.car;\n var i = 0;\n var value;\n if (typeof this !== 'undefined' && !(this instanceof Environment)) {\n if (this && !this.__instance__) {\n Object.defineProperty(this, '__instance__', {\n enumerable: false,\n get: () => true,\n set: () => {},\n configurable: false\n });\n }\n env.set('this', this);\n }\n // arguments and arguments.callee inside lambda function\n if (this instanceof Environment) {\n var options = { throwError: false };\n env.set('arguments', this.get('arguments', options));\n env.set('parent.frame', this.get('parent.frame', options));\n } else {\n // this case is for lambda as callback function in JS; e.g. setTimeout\n var _args = args.slice();\n _args.callee = lambda;\n _args.env = env;\n env.set('arguments', _args);\n }\n if (name instanceof LSymbol || name !== nil) {\n while (true) {\n if (name.car !== nil) {\n if (name instanceof LSymbol) {\n // rest argument, can also be first argument\n value = quote(Pair.fromArray(args.slice(i), false));\n env.__env__[name.__name__] = value;\n break;\n } else {\n value = args[i];\n env.__env__[name.car.__name__] = value;\n }\n }\n if (name.cdr === nil) {\n break;\n }\n i++;\n name = name.cdr;\n }\n }\n if (dynamic_scope) {\n dynamic_scope = env;\n }\n var rest = __doc__ ? code.cdr.cdr : code.cdr;\n var output = new Pair(new LSymbol('begin'), rest);\n return evaluate(output, { env, dynamic_scope, error });\n }\n var length = code.car instanceof Pair ? code.car.length() : null;\n lambda.__code__ = new Pair(new LSymbol('lambda'), code);\n lambda[__lambda__] = true;\n if (!(code.car instanceof Pair)) {\n return doc(lambda, __doc__, true); // variable arguments\n }\n // wrap and decorate with __doc__\n return doc(set_fn_length(lambda, length), __doc__, true);\n }, `(lambda (a b) body)\n (lambda args body)\n (lambda (a b . rest) body)\n\n Macro lambda create new anonymous function, if first element of the body\n is string and there is more elements it will be documentation, that can\n be read using (help fn)`),\n 'macroexpand': new Macro('macroexpand', macro_expand()),\n 'macroexpand-1': new Macro('macroexpand-1', macro_expand(true)),\n // ------------------------------------------------------------------\n 'define-macro': doc(new Macro(macro, function(macro, { dynamic_scope, error }) {\n if (macro.car instanceof Pair && macro.car.car instanceof LSymbol) {\n var name = macro.car.car.__name__;\n var __doc__;\n if (LString.isString(macro.cdr.car) && macro.cdr.cdr instanceof Pair) {\n __doc__ = macro.cdr.car.valueOf();\n }\n var makro_instance = Macro.defmacro(name, function(code) {\n var env = new Environment({}, this, 'defmacro');\n var name = macro.car.cdr;\n var arg = code;\n while (true) {\n if (name === nil) {\n break;\n }\n if (name instanceof LSymbol) {\n env.__env__[name.__name__] = arg;\n break;\n } else if (name.car !== nil) {\n if (arg === nil) {\n env.__env__[name.car.__name__] = nil;\n } else {\n if (arg.car instanceof Pair) {\n arg.car[__data__] = true;\n }\n env.__env__[name.car.__name__] = arg.car;\n }\n }\n if (name.cdr === nil) {\n break;\n }\n if (arg !== nil) {\n arg = arg.cdr;\n }\n name = name.cdr;\n }\n if (dynamic_scope) {\n dynamic_scope = env;\n }\n var eval_args = {\n env,\n dynamic_scope,\n error\n };\n // evaluate macro\n if (macro.cdr instanceof Pair) {\n // this eval will return lips code\n var rest = __doc__ ? macro.cdr.cdr : macro.cdr;\n var result = rest.reduce(function(result, node) {\n return evaluate(node, eval_args);\n });\n return unpromise(result, function(result) {\n if (typeof result === 'object') {\n delete result[__data__];\n }\n return result;\n });\n }\n }, __doc__, true);\n makro_instance.__code__ = new Pair(new LSymbol('define-macro'), macro);\n this.set(name, makro_instance);\n }\n }), `(define-macro (name . args) body)\n\n Meta macro, macro that create new macros, if return value is list structure\n it will be evaluated when macro is invoked. You can use quasiquote \\` and\n unquote , and unquote-splicing ,@ inside to create expression that will be\n evaluated on runtime. Macros works like this: if you pass any expression to\n macro the arguments will not be evaluated unless macro itself evaluate it.\n Because of this macro can manipulate expression (arguments) as lists.`),\n // ------------------------------------------------------------------\n 'syntax-rules': new Macro('syntax-rules', function(macro, options) {\n var { dynamic_scope, error } = options;\n var env = this;\n function get_identifiers(node) {\n let symbols = [];\n while (node !== nil) {\n const x = node.car;\n symbols.push(x.valueOf());\n node = node.cdr;\n }\n return symbols;\n }\n function validate_identifiers(node) {\n while (node !== nil) {\n const x = node.car;\n if (!(x instanceof LSymbol)) {\n throw new Error('syntax-rules: wrong identifier');\n }\n node = node.cdr;\n }\n }\n if (macro.car instanceof LSymbol) {\n validate_identifiers(macro.cdr.car);\n } else {\n validate_identifiers(macro.car);\n }\n const syntax = new Syntax(function(code, { macro_expand }) {\n var scope = env.inherit('syntax');\n if (dynamic_scope) {\n dynamic_scope = scope;\n }\n var var_scope = this;\n // for macros that define variables used in macro (2 levels nestting)\n if (var_scope.__name__ === Syntax.__merge_env__) {\n // copy refs for defined gynsyms\n const props = Object.getOwnPropertySymbols(var_scope.__env__);\n props.forEach(symbol => {\n var_scope.__parent__.set(symbol, var_scope.__env__[symbol]);\n });\n var_scope = var_scope.__parent__;\n }\n var eval_args = { env: scope, dynamic_scope, error };\n let ellipsis, rules, symbols;\n if (macro.car instanceof LSymbol) {\n ellipsis = macro.car;\n symbols = get_identifiers(macro.cdr.car);\n rules = macro.cdr.cdr;\n } else {\n ellipsis = '...';\n symbols = get_identifiers(macro.car);\n rules = macro.cdr;\n }\n try {\n while (rules !== nil) {\n var rule = rules.car.car;\n var expr = rules.car.cdr.car;\n log(rule);\n var bindings = extract_patterns(rule, code, symbols, ellipsis, {\n expansion: this, define: env\n });\n if (bindings) {\n /* istanbul ignore next */\n if (is_debug()) {\n console.log(JSON.stringify(symbolize(bindings), true, 2));\n console.log('PATTERN: ' + rule.toString(true));\n console.log('MACRO: ' + code.toString(true));\n }\n // name is modified in transform_syntax\n var names = [];\n const new_expr = transform_syntax({\n bindings,\n expr,\n symbols,\n scope,\n lex_scope: var_scope,\n names,\n ellipsis\n });\n log('OUPUT>>> ' + new_expr.toString());\n if (new_expr) {\n expr = new_expr;\n }\n var new_env = var_scope.merge(scope, Syntax.__merge_env__);\n if (macro_expand) {\n return { expr, scope: new_env };\n }\n var result = evaluate(expr, { ...eval_args, env: new_env });\n // Hack: update the result if there are generated\n // gensyms that should be literal symbols\n // TODO: maybe not the part move when literal elisps may\n // be generated, maybe they will need to be mark somehow\n return clear_gensyms(result, names);\n }\n rules = rules.cdr;\n }\n } catch (e) {\n e.message += ` in macro: ${macro.toString(true)}`;\n throw e;\n }\n throw new Error(`Invalid Syntax ${code.toString(true)}`);\n }, env);\n syntax.__code__ = macro;\n return syntax;\n }, `(syntax-rules () (pattern expression) ...)\n\n Base of Hygienic macro, it will return new syntax expander\n that works like lisp macros.`),\n // ------------------------------------------------------------------\n quote: doc(new Macro('quote', function(arg) {\n return quote(arg.car);\n }), `(quote expression)\n\n Macro that return single lips expression as data (it don't evaluate its\n argument). It will return list of pairs if put in front of lips code.\n And if put in fron of symbol it will return that symbol not value\n associated with that name.`),\n 'unquote-splicing': doc('unquote-splicing', function() {\n throw new Error(`You can't call \\`unquote-splicing\\` outside of quasiquote`);\n }, `(unquote-splicing code)\n\n Special form to be used in quasiquote macro, parser is processing special\n characters ,@ and create call to this pseudo function. It can be used\n to evaluate expression inside and return the value without parenthesis.\n the value will be joined to the output list structure.`),\n 'unquote': doc('unquote', function() {\n throw new Error(`You can't call \\`unquote\\` outside of quasiquote`);\n }, `(unquote code)\n\n Special form to be used in quasiquote macro, parser is processing special\n characters , and create call to this pseudo function. It can be used\n to evaluate expression inside and return the value, the output is inserted\n into list structure created by queasiquote.`),\n // ------------------------------------------------------------------\n quasiquote: Macro.defmacro('quasiquote', function(arg, env) {\n var { dynamic_scope, error } = env;\n var self = this;\n //var max_unquote = 1;\n if (dynamic_scope) {\n dynamic_scope = self;\n }\n // -----------------------------------------------------------------\n function is_struct(value) {\n return value instanceof Pair ||\n is_plain_object(value) ||\n Array.isArray(value);\n }\n // -----------------------------------------------------------------\n function resolve_pair(pair, fn, test = is_struct) {\n if (pair instanceof Pair) {\n var car = pair.car;\n var cdr = pair.cdr;\n if (test(car)) {\n car = fn(car);\n }\n if (test(cdr)) {\n cdr = fn(cdr);\n }\n if (is_promise(car) || is_promise(cdr)) {\n return promise_all([car, cdr]).then(([car, cdr]) => {\n return new Pair(car, cdr);\n });\n } else {\n return new Pair(car, cdr);\n }\n }\n return pair;\n }\n // -----------------------------------------------------------------\n function join(eval_pair, value) {\n if (eval_pair === nil && value === nil) {\n //return nil;\n }\n if (eval_pair instanceof Pair) {\n if (value !== nil) {\n eval_pair.append(value);\n }\n } else {\n eval_pair = new Pair(\n eval_pair,\n value\n );\n }\n return eval_pair;\n }\n // -----------------------------------------------------------------\n function unquoted_arr(arr) {\n return !!arr.filter(value => {\n return value instanceof Pair &&\n LSymbol.is(value.car, /^(unquote|unquote-splicing)$/);\n }).length;\n }\n // -----------------------------------------------------------------\n function quote_vector(arr, unquote_cnt, max_unq) {\n return arr.reduce((acc, x) => {\n if (!(x instanceof Pair)) {\n acc.push(x);\n return acc;\n }\n if (LSymbol.is(x.car, 'unquote-splicing')) {\n let result;\n if (unquote_cnt + 1 < max_unq) {\n result = recur(x.cdr, unquote_cnt + 1, max_unq);\n } else {\n result = evaluate(x.cdr.car, {\n env: self,\n dynamic_scope,\n error\n });\n }\n if (!(result instanceof Pair)) {\n throw new Error(`Expecting list ${type(x)} found`);\n }\n return acc.concat(result.to_array());\n }\n acc.push(recur(x, unquote_cnt, max_unq));\n return acc;\n }, []);\n }\n // -----------------------------------------------------------------\n function quote_object(object, unquote_cnt, max_unq) {\n const result = {};\n unquote_cnt++;\n Object.keys(object).forEach(key => {\n const value = object[key];\n if (value instanceof Pair) {\n if (LSymbol.is(value.car, 'unquote-splicing')) {\n throw new Error(\"You can't call `unquote-splicing` \" +\n \"inside object\");\n }\n let output;\n if (unquote_cnt < max_unq) {\n output = recur(value.cdr.car, unquote_cnt, max_unq);\n } else {\n output = evaluate(value.cdr.car, {\n env: self,\n dynamic_scope,\n error\n });\n }\n result[key] = output;\n } else {\n result[key] = value;\n }\n });\n if (Object.isFrozen(object)) {\n Object.freeze(result);\n }\n return result;\n }\n // -----------------------------------------------------------------\n function unquote_splice(pair, unquote_cnt, max_unq) {\n if (unquote_cnt < max_unq) {\n return new Pair(\n new Pair(\n pair.car.car,\n recur(pair.car.cdr, unquote_cnt, max_unq)\n ),\n nil\n );\n }\n var lists = [];\n return (function next(node) {\n var value = evaluate(node.car, {\n env: self,\n dynamic_scope,\n error\n });\n lists.push(value);\n if (node.cdr instanceof Pair) {\n return next(node.cdr);\n }\n return unpromise(lists, function(arr) {\n if (arr.some(x => !(x instanceof Pair))) {\n if (pair.cdr instanceof Pair &&\n LSymbol.is(pair.cdr.car, '.') &&\n pair.cdr.cdr instanceof Pair &&\n pair.cdr.cdr.cdr === nil) {\n return pair.cdr.cdr.car;\n }\n if (!(pair.cdr === nil || pair.cdr instanceof Pair)) {\n const msg = \"You can't splice atom inside list\";\n throw new Error(msg);\n }\n if (arr.length > 1) {\n const msg = \"You can't splice multiple atoms inside list\";\n throw new Error(msg);\n }\n if (!(pair.cdr instanceof Pair && arr[0] === nil)) {\n return arr[0];\n }\n }\n // don't create Cycles\n arr = arr.map(eval_pair => {\n if (splices.has(eval_pair)) {\n return eval_pair.clone();\n } else {\n splices.add(eval_pair);\n return eval_pair;\n }\n });\n const value = recur(pair.cdr, 0, 1);\n if (value === nil && arr[0] === nil) {\n return undefined;\n }\n return unpromise(value, value => {\n if (arr[0] === nil) {\n return value;\n }\n if (arr.length === 1) {\n return join(arr[0], value);\n }\n var result = arr.reduce((result, eval_pair) => {\n return join(result, eval_pair);\n });\n return join(result, value);\n });\n });\n })(pair.car.cdr);\n }\n // -----------------------------------------------------------------\n var splices = new Set();\n function recur(pair, unquote_cnt, max_unq) {\n if (pair instanceof Pair) {\n if (pair.car instanceof Pair) {\n if (LSymbol.is(pair.car.car, 'unquote-splicing')) {\n return unquote_splice(pair, unquote_cnt + 1, max_unq);\n }\n if (LSymbol.is(pair.car.car, 'unquote')) {\n // + 2 - one for unquote and one for unquote splicing\n if (unquote_cnt + 2 === max_unq &&\n pair.car.cdr instanceof Pair &&\n pair.car.cdr.car instanceof Pair &&\n LSymbol.is(pair.car.cdr.car.car, 'unquote-splicing')) {\n const rest = pair.car.cdr;\n return new Pair(\n new Pair(\n new LSymbol('unquote'),\n unquote_splice(rest, unquote_cnt + 2, max_unq)\n ),\n nil\n );\n } else if (pair.car.cdr instanceof Pair &&\n pair.car.cdr.cdr !== nil) {\n if (pair.car.cdr.car instanceof Pair) {\n // values inside unquote are lists\n const result = [];\n return (function recur(node) {\n if (node === nil) {\n return Pair.fromArray(result);\n }\n return unpromise(evaluate(node.car, {\n env: self,\n dynamic_scope,\n error\n }), function(next) {\n result.push(next);\n return recur(node.cdr);\n });\n })(pair.car.cdr);\n } else {\n // same as in guile if (unquote 1 2 3) it should be\n // spliced - scheme spec say it's unspecify but it\n // work like in CL\n return pair.car.cdr;\n }\n }\n }\n }\n if (LSymbol.is(pair.car, 'quasiquote')) {\n var cdr = recur(pair.cdr, unquote_cnt, max_unq + 1);\n return new Pair(pair.car, cdr);\n }\n if (LSymbol.is(pair.car, 'quote')) {\n return new Pair(\n pair.car,\n recur(pair.cdr, unquote_cnt, max_unq)\n );\n }\n if (LSymbol.is(pair.car, 'unquote')) {\n unquote_cnt++;\n if (unquote_cnt < max_unq) {\n return new Pair(\n new LSymbol('unquote'),\n recur(pair.cdr, unquote_cnt, max_unq)\n );\n }\n if (unquote_cnt > max_unq) {\n throw new Error(\"You can't call `unquote` outside \" +\n \"of quasiquote\");\n }\n if (pair.cdr instanceof Pair) {\n if (pair.cdr.cdr !== nil) {\n if (pair.cdr.car instanceof Pair) {\n // TODO: test if this part is needed\n // this part was duplicated in previous section\n // if (LSymbol.is(pair.car.car, 'unquote')) {\n // so this probably can be removed\n const result = [];\n // evaluate all values in unquote\n return (function recur(node) {\n if (node === nil) {\n return Pair.fromArray(result);\n }\n return unpromise(evaluate(node.car, {\n env: self,\n dynamic_scope,\n error\n }), function(next) {\n result.push(next);\n return recur(node.cdr);\n });\n })(pair.cdr);\n } else {\n return pair.cdr;\n }\n } else {\n return evaluate(pair.cdr.car, {\n env: self,\n dynamic_scope,\n error\n });\n }\n } else {\n return pair.cdr;\n }\n }\n return resolve_pair(pair, (pair) => {\n return recur(pair, unquote_cnt, max_unq);\n });\n } else if (is_plain_object(pair)) {\n return quote_object(pair, unquote_cnt, max_unq);\n } else if (pair instanceof Array) {\n return quote_vector(pair, unquote_cnt, max_unq);\n }\n return pair;\n }\n // -----------------------------------------------------------------\n function clear(node) {\n if (node instanceof Pair) {\n delete node[__data__];\n if (!node.haveCycles('car')) {\n clear(node.car);\n }\n if (!node.haveCycles('cdr')) {\n clear(node.cdr);\n }\n }\n }\n // -----------------------------------------------------------------\n if (is_plain_object(arg.car) && !unquoted_arr(Object.values(arg.car))) {\n return quote(arg.car);\n }\n if (Array.isArray(arg.car) && !unquoted_arr(arg.car)) {\n return quote(arg.car);\n }\n if (arg.car instanceof Pair &&\n !arg.car.find('unquote') &&\n !arg.car.find('unquote-splicing') &&\n !arg.car.find('quasiquote')) {\n return quote(arg.car);\n }\n var x = recur(arg.car, 0, 1);\n return unpromise(x, value => {\n // clear nested data for tests\n clear(value);\n return quote(value);\n });\n }, `(quasiquote list ,value ,@value)\n\n Similar macro to \\`quote\\` but inside it you can use special\n expressions unquote abbreviated to , that will evaluate expression inside\n and return its value or unquote-splicing abbreviated to ,@ that will\n evaluate expression but return value without parenthesis (it will join)\n the list with its value. Best used with macros but it can be used outside`),\n // ------------------------------------------------------------------\n clone: doc('clone', function clone(list) {\n typecheck('clone', list, 'pair');\n return list.clone();\n }, `(clone list)\n\n Function return clone of the list.`),\n // ------------------------------------------------------------------\n append: doc('append', function append(...items) {\n items = items.map(item => {\n if (item instanceof Pair) {\n return item.clone();\n }\n return item;\n });\n return global_env.get('append!').call(this, ...items);\n }, `(append item ...)\n\n Function will create new list with eac argument appended to the end.\n It will always return new list and not modify it's arguments.`),\n // ------------------------------------------------------------------\n 'append!': doc('append!', function(...items) {\n var is_list = global_env.get('list?');\n return items.reduce((acc, item) => {\n typecheck('append!', acc, ['nil', 'pair']);\n if ((item instanceof Pair || item === nil) && !is_list(item)) {\n throw new Error('append!: Invalid argument, value is not a list');\n }\n if (is_null(item)) {\n return acc;\n }\n if (acc === nil) {\n if (item === nil) {\n return nil;\n }\n return item;\n }\n return acc.append(item);\n }, nil);\n }, `(append! arg1 ...)\n\n Destructive version of append, it modify the list in place. It return\n new list where each argument is appened to the end. It may modify\n lists added as arguments.`),\n // ------------------------------------------------------------------\n reverse: doc('reverse', function reverse(arg) {\n typecheck('reverse', arg, ['array', 'pair', 'nil']);\n if (arg === nil) {\n return nil;\n }\n if (arg instanceof Pair) {\n var arr = global_env.get('list->array')(arg).reverse();\n return global_env.get('array->list')(arr);\n } else if (!(arg instanceof Array)) {\n throw new Error(typeErrorMessage('reverse', type(arg), 'array or pair'));\n } else {\n return arg.reverse();\n }\n }, `(reverse list)\n\n Function will reverse the list or array. If value is not a list\n or array it will throw exception.`),\n // ------------------------------------------------------------------\n nth: doc('nth', function nth(index, obj) {\n typecheck('nth', index, 'number');\n typecheck('nth', obj, ['array', 'pair']);\n if (obj instanceof Pair) {\n var node = obj;\n var count = 0;\n while (count < index) {\n if (!node.cdr || node.cdr === nil || node.haveCycles('cdr')) {\n return nil;\n }\n node = node.cdr;\n count++;\n }\n return node.car;\n } else if (obj instanceof Array) {\n return obj[index];\n } else {\n throw new Error(typeErrorMessage('nth', type(obj), 'array or pair', 2));\n }\n }, `(nth index obj)\n\n Function return nth element of the list or array. If used with different\n value it will throw exception`),\n // ------------------------------------------------------------------\n list: doc('list', function list(...args) {\n return args.reverse().reduce((list, item) => new Pair(item, list), nil);\n }, `(list . args)\n\n Function create new list out of its arguments.`),\n // ------------------------------------------------------------------\n substring: doc('substring', function substring(string, start, end) {\n typecheck('substring', string, 'string');\n typecheck('substring', start, 'number');\n typecheck('substring', end, ['number', 'undefined']);\n return string.substring(start.valueOf(), end && end.valueOf());\n }, `(substring string start end)\n\n Function return part of the string starting at start ending with end.`),\n // ------------------------------------------------------------------\n concat: doc('concat', function concat(...args) {\n args.forEach((arg, i) => typecheck('concat', arg, 'string', i + 1));\n return args.join('');\n }, `(concat . strings)\n\n Function create new string by joining its arguments`),\n // ------------------------------------------------------------------\n join: doc('join', function join(separator, list) {\n typecheck('join', separator, 'string');\n typecheck('join', list, ['pair', 'nil']);\n return global_env.get('list->array')(list).join(separator);\n }, `(join separator list)\n\n Function return string by joining elements of the list`),\n // ------------------------------------------------------------------\n split: doc('split', function split(separator, string) {\n typecheck('split', separator, ['regex', 'string']);\n typecheck('split', string, 'string');\n return global_env.get('array->list')(string.split(separator));\n }, `(split separator string)\n\n Function create list by splitting string by separatar that can\n be a string or regular expression.`),\n // ------------------------------------------------------------------\n replace: doc('replace', function replace(pattern, replacement, string) {\n typecheck('replace', pattern, ['regex', 'string']);\n typecheck('replace', replacement, ['string', 'function']);\n typecheck('replace', string, 'string');\n return string.replace(pattern, replacement);\n }, `(replace pattern replacement string)\n\n Function change pattern to replacement inside string. Pattern can be string\n or regex and replacement can be function or string.`),\n // ------------------------------------------------------------------\n match: doc('match', function match(pattern, string) {\n typecheck('match', pattern, ['regex', 'string']);\n typecheck('match', string, 'string');\n var m = string.match(pattern);\n return m ? global_env.get('array->list')(m) : false;\n }, `(match pattern string)\n\n function return match object from JavaScript as list or #f if not match.`),\n // ------------------------------------------------------------------\n search: doc('search', function search(pattern, string) {\n typecheck('search', pattern, ['regex', 'string']);\n typecheck('search', string, 'string');\n return string.search(pattern);\n }, `(search pattern string)\n\n Function return first found index of the pattern inside a string`),\n // ------------------------------------------------------------------\n repr: doc('repr', function repr(obj, quote) {\n return toString(obj, quote);\n }, `(repr obj)\n\n Function return string LIPS representation of an object as string.`),\n // ------------------------------------------------------------------\n 'escape-regex': doc('escape-regex', function(string) {\n typecheck('escape-regex', string, 'string');\n return escape_regex(string.valueOf());\n }, `(escape-regex string)\n\n Function return new string where all special operators used in regex,\n are escaped with slash so they can be used in RegExp constructor\n to match literal string`),\n // ------------------------------------------------------------------\n env: doc('env', function env(env) {\n env = env || this;\n var names = Object.keys(env.__env__).map(LSymbol);\n // TODO: get symbols\n var result;\n if (names.length) {\n result = Pair.fromArray(names);\n } else {\n result = nil;\n }\n if (env.__parent__ instanceof Environment) {\n return global_env.get('env')(env.__parent__).append(result);\n }\n return result;\n }, `(env)\n (env obj)\n\n Function return list of values (functions, macros and variables)\n inside environment and it's parents.`),\n // ------------------------------------------------------------------\n 'new': doc('new', function(obj, ...args) {\n var instance = new (unbind(obj))(...args.map(x => unbox(x)));\n return instance;\n }, `(new obj . args)\n\n Function create new JavaScript instance of an object.`),\n // ------------------------------------------------------------------\n 'typecheck': doc(\n typecheck,\n `(typecheck label value type [position])\n\n Function check type and throw exception if type don't match.\n Type can be string or list of strings. Position optional argument\n is used to created proper error message.`),\n // ------------------------------------------------------------------\n 'unset-special!': doc('unset-special!', function(symbol) {\n typecheck('remove-special!', symbol, 'string');\n delete specials.remove(symbol.valueOf());\n }, `(unset-special! name)\n\n Function remove special symbol from parser. Added by \\`set-special!\\`,\n name must be a string.`),\n // ------------------------------------------------------------------\n 'set-special!': doc('set-special!', function(seq, name, type = specials.LITERAL) {\n typecheck('set-special!', seq, 'string', 1);\n typecheck('set-special!', name, 'symbol', 2);\n specials.append(seq.valueOf(), name, type);\n }, `(set-special! symbol name [type])\n\n Add special symbol to the list of transforming operators by the parser.\n e.g.: \\`(add-special! \"#\" 'x)\\` will allow to use \\`#(1 2 3)\\` and it will be\n transformed into (x (1 2 3)) so you can write x macro that will process\n the list. 3rd argument is optional and it can be constant value\n lips.specials.SPLICE if this constant is used it will transform\n \\`#(1 2 3)\\` into (x 1 2 3) that is required by # that define vectors.`),\n // ------------------------------------------------------------------\n 'get': get,\n '.': get,\n // ------------------------------------------------------------------\n 'unbind': doc(\n unbind,\n `(unbind fn)\n\n Function remove binding from function so you can get props from it.`),\n // ------------------------------------------------------------------\n type: doc(\n type,\n `(type object)\n\n Function return type of an object as string.`),\n // ------------------------------------------------------------------\n 'debugger': doc('debugger', function() {\n /* eslint-disable */\n debugger;\n /* eslint-enable */\n }, `(debugger)\n\n Function stop JavaScript code in debugger.`),\n // ------------------------------------------------------------------\n 'in': doc('in', function(a, b) {\n if (a instanceof LSymbol ||\n a instanceof LString ||\n a instanceof LNumber) {\n a = a.valueOf();\n }\n return a in unbox(b);\n }, `(in key value)\n\n Function use is in operator to check if value is in object.`),\n // ------------------------------------------------------------------\n 'instanceof': doc('instanceof', function(type, obj) {\n return obj instanceof unbind(type);\n }, `(instanceof type obj)\n\n Function check of object is instance of object.`),\n // ------------------------------------------------------------------\n 'prototype?': doc(\n 'prototype?',\n is_prototype,\n `(prototype? obj)\n\n Function check if value is JavaScript Object prototype.`),\n // ------------------------------------------------------------------\n 'macro?': doc('macro?', function(obj) {\n return obj instanceof Macro;\n }, `(macro? expression)\n\n Function check if value is a macro.`),\n // ------------------------------------------------------------------\n 'function?': doc(\n 'function?',\n is_function,\n `(function? expression)\n\n Function check if value is a function.`),\n // ------------------------------------------------------------------\n 'real?': doc('real?', function(value) {\n if (type(value) !== 'number') {\n return false;\n }\n if (value instanceof LNumber) {\n return value.isFloat();\n }\n return LNumber.isFloat(value);\n }, `(real? number)\n\n Function check if value is real number.`),\n // ------------------------------------------------------------------\n 'number?': doc('number?', function(x) {\n return Number.isNaN(x) || LNumber.isNumber(x);\n }, `(number? expression)\n\n Function check if value is a number or NaN value.`),\n // ------------------------------------------------------------------\n 'string?': doc('string?', function(obj) {\n return LString.isString(obj);\n }, `(string? expression)\n\n Function check if value is a string.`),\n // ------------------------------------------------------------------\n 'pair?': doc('pair?', function(obj) {\n return obj instanceof Pair;\n }, `(pair? expression)\n\n Function check if value is a pair or list structure.`),\n // ------------------------------------------------------------------\n 'regex?': doc('regex?', function(obj) {\n return obj instanceof RegExp;\n }, `(regex? expression)\n\n Function check if value is regular expression.`),\n // ------------------------------------------------------------------\n 'null?': doc('null?', function(obj) {\n return is_null(obj);\n }, `(null? expression)\n\n Function check if value is nulish.`),\n // ------------------------------------------------------------------\n 'boolean?': doc('boolean?', function(obj) {\n return typeof obj === 'boolean';\n }, `(boolean? expression)\n\n Function check if value is boolean.`),\n // ------------------------------------------------------------------\n 'symbol?': doc('symbol?', function(obj) {\n return obj instanceof LSymbol;\n }, `(symbol? expression)\n\n Function check if value is LIPS symbol`),\n // ------------------------------------------------------------------\n 'array?': doc('array?', function(obj) {\n return obj instanceof Array;\n }, `(array? expression)\n\n Function check if value is an array.`),\n // ------------------------------------------------------------------\n 'object?': doc('object?', function(obj) {\n return obj !== nil && obj !== null &&\n !(obj instanceof LCharacter) &&\n !(obj instanceof RegExp) &&\n !(obj instanceof LString) &&\n !(obj instanceof Pair) &&\n !(obj instanceof LNumber) &&\n typeof obj === 'object' &&\n !(obj instanceof Array);\n }, `(object? expression)\n\n Function check if value is an plain object.`),\n // ------------------------------------------------------------------\n flatten: doc('flatten', function flatten(list) {\n typecheck('flatten', list, 'pair');\n return list.flatten();\n }, `(flatten list)\n\n Return shallow list from tree structure (pairs).`),\n // ------------------------------------------------------------------\n 'array->list': doc('array->list', function(array) {\n typecheck('array->list', array, 'array');\n return Pair.fromArray(array);\n }, `(array->list array)\n\n Function convert JavaScript array to LIPS list.`),\n // ------------------------------------------------------------------\n 'tree->array': doc(\n 'tree->array',\n to_array('tree->array', true),\n `(tree->array list)\n\n Function convert LIPS list structure into JavaScript array.`),\n // ------------------------------------------------------------------\n 'list->array': doc(\n 'list->array',\n to_array('list->array'),\n `(list->array list)\n\n Function convert LIPS list into JavaScript array.`),\n // ------------------------------------------------------------------\n apply: doc('apply', function apply(fn, ...args) {\n typecheck('apply', fn, 'function', 1);\n var last = args.pop();\n typecheck('apply', last, ['pair', 'nil'], args.length + 2);\n args = args.concat(global_env.get('list->array').call(this, last));\n return fn.apply(this, prepare_fn_args(fn, args));\n }, `(apply fn list)\n\n Function that call function with list of arguments.`),\n // ------------------------------------------------------------------\n length: doc('length', function length(obj) {\n if (!obj || obj === nil) {\n return 0;\n }\n if (obj instanceof Pair) {\n return obj.length();\n }\n if (\"length\" in obj) {\n return obj.length;\n }\n }, `(length expression)\n\n Function return length of the object, the object can be list\n or any object that have length property.`),\n // ------------------------------------------------------------------\n 'string->number': doc('string->number', function(arg, radix = 10) {\n typecheck('string->number', arg, 'string', 1);\n typecheck('string->number', radix, 'number', 2);\n arg = arg.valueOf();\n radix = radix.valueOf();\n if (arg.match(rational_bare_re) || arg.match(rational_re)) {\n return parse_rational(arg, radix);\n } else if (arg.match(complex_bare_re) || arg.match(complex_re)) {\n return parse_complex(arg, radix);\n } else {\n const valid_bare = (radix === 10 && !arg.match(/e/i)) || radix === 16;\n if (arg.match(int_bare_re) && valid_bare || arg.match(int_re)) {\n return parse_integer(arg, radix);\n }\n if (arg.match(float_re)) {\n return parse_float(arg);\n }\n }\n return false;\n }, `(string->number number [radix])\n\n Function convert string to number.`),\n // ------------------------------------------------------------------\n 'try': doc(new Macro('try', function(code, { dynamic_scope, error }) {\n return new Promise((resolve, reject) => {\n var catch_clause, finally_clause;\n if (LSymbol.is(code.cdr.car.car, 'catch')) {\n catch_clause = code.cdr.car;\n if (code.cdr.cdr instanceof Pair &&\n LSymbol.is(code.cdr.cdr.car.car, 'finally')) {\n finally_clause = code.cdr.cdr.car;\n }\n } else if (LSymbol.is(code.cdr.car.car, 'finally')) {\n finally_clause = code.cdr.car;\n }\n if (!(finally_clause || catch_clause)) {\n throw new Error('try: invalid syntax');\n }\n var next = resolve;\n if (finally_clause) {\n next = function(result, cont) {\n // prevent infinite loop when finally throw exception\n next = reject;\n unpromise(evaluate(new Pair(\n new LSymbol('begin'),\n finally_clause.cdr\n ), args), function() {\n cont(result);\n });\n };\n }\n var args = {\n env: this,\n error: (e) => {\n var env = this.inherit('try');\n if (catch_clause) {\n env.set(catch_clause.cdr.car.car, e);\n var args = {\n env,\n error\n };\n if (dynamic_scope) {\n args.dynamic_scope = this;\n }\n unpromise(evaluate(new Pair(\n new LSymbol('begin'),\n catch_clause.cdr.cdr\n ), args), function(result) {\n next(result, resolve);\n });\n } else {\n next(e, error);\n }\n }\n };\n if (dynamic_scope) {\n args.dynamic_scope = this;\n }\n var result = evaluate(code.car, args);\n if (is_promise(result)) {\n result.then(result => {\n next(result, resolve);\n }).catch(args.error);\n } else {\n next(result, resolve);\n }\n });\n }), `(try expr (catch (e) code))\n (try expr (catch (e) code) (finally code))\n (try expr (finally code))\n\n Macro execute user code and catch exception. If catch is provided\n it's executed when expression expr throw error. If finally is provide\n it's always executed at the end.`),\n // ------------------------------------------------------------------\n 'raise': doc('raise', function(obj) {\n throw obj;\n }, `(raise obj)\n\n Throws new exception with given object.`),\n 'throw': doc('throw', function(message) {\n throw new Error(message);\n }, `(throw string)\n\n Throws new expection.`),\n // ------------------------------------------------------------------\n find: doc('find', function find(arg, list) {\n typecheck('find', arg, ['regex', 'function']);\n typecheck('find', list, ['pair', 'nil']);\n if (is_null(list)) {\n return nil;\n }\n var fn = matcher('find', arg);\n return unpromise(fn(list.car), function(value) {\n if (value && value !== nil) {\n return list.car;\n }\n return find(arg, list.cdr);\n });\n }, `(find fn list)\n (find regex list)\n\n Higher order Function find first value for which function return true.\n If called with regex it will create matcher function.`),\n // ------------------------------------------------------------------\n 'for-each': doc('for-each', function(fn, ...lists) {\n typecheck('for-each', fn, 'function');\n lists.forEach((arg, i) => {\n typecheck('for-each', arg, ['pair', 'nil'], i + 1);\n });\n // we need to use call(this because babel transpile this code into:\n // var ret = map.apply(void 0, [fn].concat(lists));\n // it don't work with weakBind\n var ret = global_env.get('map').call(this, fn, ...lists);\n if (is_promise(ret)) {\n return ret.then(() => {});\n }\n }, `(for-each fn . lists)\n\n Higher order function that call function \\`fn\\` by for each\n value of the argument. If you provide more then one list as argument\n it will take each value from each list and call \\`fn\\` function\n with that many argument as number of list arguments.`),\n // ------------------------------------------------------------------\n map: doc('map', function map(fn, ...lists) {\n typecheck('map', fn, 'function');\n var is_list = global_env.get('list?');\n lists.forEach((arg, i) => {\n typecheck('map', arg, ['pair', 'nil'], i + 1);\n // detect cycles\n if (arg instanceof Pair && !is_list.call(this, arg)) {\n throw new Error(`map: argument ${i + 1} is not a list`);\n }\n });\n if (lists.length === 0) {\n return nil;\n }\n if (lists.some(x => x === nil)) {\n return nil;\n }\n var args = lists.map(l => l.car);\n var parent_frame = this.get('parent.frame');\n var env = this.newFrame(fn, args);\n env.set('parent.frame', parent_frame);\n return unpromise(fn.call(env, ...args), (head) => {\n return unpromise(map.call(this, fn, ...lists.map(l => l.cdr)), (rest) => {\n return new Pair(head, rest);\n });\n });\n }, `(map fn . lists)\n\n Higher order function that call function \\`fn\\` by for each\n value of the argument. If you provide more then one list as argument\n it will take each value from each list and call \\`fn\\` function\n with that many argument as number of list arguments. The return\n values of the function call is accumulated in result list and\n returned by the call to map.`),\n // ------------------------------------------------------------------\n 'list?': doc('list?', function(obj) {\n var node = obj;\n while (true) {\n if (node === nil) {\n return true;\n }\n if (!(node instanceof Pair)) {\n return false;\n }\n if (node.haveCycles('cdr')) {\n return false;\n }\n node = node.cdr;\n }\n }, `(list? obj)\n\n Function test if value is proper linked list structure.\n The car of each pair can be any value. It return false on cycles.\"`),\n // ------------------------------------------------------------------\n some: doc('some', function some(fn, list) {\n typecheck('some', fn, 'function');\n typecheck('some', list, ['pair', 'nil']);\n if (is_null(list)) {\n return false;\n } else {\n return unpromise(fn(list.car), (value) => {\n return value || some(fn, list.cdr);\n });\n }\n }, `(some fn list)\n\n Higher order function that call argument on each element of the list.\n It stops when function fn return true for a value if so it will\n return true. If none of the values give true, the function return false`),\n // ------------------------------------------------------------------\n fold: doc('fold', fold('fold', function(fold, fn, init, ...lists) {\n typecheck('fold', fn, 'function');\n lists.forEach((arg, i) => {\n typecheck('fold', arg, ['pair', 'nil'], i + 1);\n });\n if (lists.some(x => x === nil)) {\n return init;\n }\n const value = fold.call(this, fn, init, ...lists.map(l => l.cdr));\n return unpromise(value, value => {\n return fn(...lists.map(l => l.car), value);\n });\n }), `(fold fn init . lists)\n\n Function fold is reverse of the reduce. it call function \\`fn\\`\n on each elements of the list and return single value.\n e.g. it call (fn a1 b1 (fn a2 b2 (fn a3 b3 '())))\n for: (fold fn '() alist blist)`),\n // ------------------------------------------------------------------\n pluck: doc('pluck', function pluck(...keys) {\n return function(obj) {\n keys = keys.map(x => x instanceof LSymbol ? x.__name__ : x);\n if (keys.length === 0) {\n return nil;\n } else if (keys.length === 1) {\n const [key] = keys;\n return obj[key];\n }\n var result = {};\n keys.forEach((key) => {\n result[key] = obj[key];\n });\n return result;\n };\n }, `(pluck . string)\n\n If called with single string it will return function that will return\n key from object. If called with more then one argument function will\n return new object by taking all properties from given object.`),\n // ------------------------------------------------------------------\n reduce: doc('reduce', fold('reduce', function(reduce, fn, init, ...lists) {\n typecheck('reduce', fn, 'function');\n lists.forEach((arg, i) => {\n typecheck('reduce', arg, ['pair', 'nil'], i + 1);\n });\n if (lists.some(x => x === nil)) {\n return init;\n }\n return unpromise(fn(...lists.map(l => l.car), init), (value) => {\n return reduce.call(this, fn, value, ...lists.map(l => l.cdr));\n });\n }), `(reduce fn init list . lists)\n\n Higher order function take each element of the list and call\n the function with result of previous call or init and next element\n on the list until each element is processed and return single value\n as result of last call to \\`fn\\` function.\n e.g. it call (fn a3 b3 (fn a2 b2 (fn a1 b1 init)))\n for (reduce fn init alist blist)`),\n // ------------------------------------------------------------------\n filter: doc('filter', function filter(arg, list) {\n typecheck('filter', arg, ['regex', 'function']);\n typecheck('filter', list, ['pair', 'nil']);\n var array = global_env.get('list->array')(list);\n var result = [];\n var fn = matcher('filter', arg);\n return (function loop(i) {\n function next(value) {\n if (value && value !== nil) {\n result.push(item);\n }\n return loop(++i);\n }\n if (i === array.length) {\n return Pair.fromArray(result);\n }\n var item = array[i];\n return unpromise(fn(item), next);\n })(0);\n }, `(filter fn list)\n (filter regex list)\n\n Higher order function that call \\`fn\\` for each element of the list\n and return list for only those elements for which function return\n true value. If called with regex it will create matcher function.`),\n // ------------------------------------------------------------------\n compose: doc(\n compose,\n `(compose . fns)\n\n Higher order function and create new function that apply all functions\n From right to left and return it's value. Reverse of compose.\n e.g.:\n ((compose (curry + 2) (curry * 3)) 3)\n 11\n `),\n pipe: doc(\n pipe,\n `(pipe . fns)\n\n Higher order function and create new function that apply all functions\n From left to right and return it's value. Reverse of compose.\n e.g.:\n ((pipe (curry + 2) (curry * 3)) 3)\n 15`),\n curry: doc(\n curry,\n `(curry fn . args)\n\n Higher order function that create curried version of the function.\n The result function will have partially applied arguments and it\n will keep returning functions until all arguments are added\n\n e.g.:\n (define (add a b c d) (+ a b c d))\n (define add1 (curry add 1))\n (define add12 (add 2))\n (display (add12 3 4))`),\n // ------------------------------------------------------------------\n // Numbers\n // ------------------------------------------------------------------\n gcd: doc('gcd', function gcd(...args) {\n typecheck_args('lcm', args, 'number');\n return args.reduce(function(result, item) {\n return result.gcd(item);\n });\n }, `(gcd n1 n2 ...)\n\n Function return the greatest common divisor of their arguments.`),\n // ------------------------------------------------------------------\n lcm: doc('lcm', function lcm(...args) {\n typecheck_args('lcm', args, 'number');\n // ref: https://rosettacode.org/wiki/Least_common_multiple#JavaScript\n var n = args.length, a = abs(args[0]);\n for (var i = 1; i < n; i++) {\n var b = abs(args[i]), c = a;\n while (a && b) {\n a > b ? a %= b : b %= a;\n }\n a = abs(c * args[i]) / (a + b);\n }\n return LNumber(a);\n }, `(lcm n1 n2 ...)\n\n Function return the least common multiple of their arguments.`),\n // ------------------------------------------------------------------\n 'odd?': doc('odd?', single_math_op(function(num) {\n return LNumber(num).isOdd();\n }), `(odd? number)\n\n Function check if number os odd.`),\n // ------------------------------------------------------------------\n 'even?': doc('even?', single_math_op(function(num) {\n return LNumber(num).isEven();\n }), `(even? number)\n\n Function check if number is even.`),\n // ------------------------------------------------------------------\n // math functions\n '*': doc('*', reduce_math_op(function(a, b) {\n return LNumber(a).mul(b);\n }, LNumber(1)), `(* . numbers)\n\n Multiplicate all numbers passed as arguments. If single value is passed\n it will return that value.`),\n // ------------------------------------------------------------------\n '+': doc('+', reduce_math_op(function(a, b) {\n return LNumber(a).add(b);\n }, LNumber(0)), `(+ . numbers)\n\n Sum all numbers passed as arguments. If single value is passed it will\n return that value.`),\n // ------------------------------------------------------------------\n '-': doc('-', function(...args) {\n if (args.length === 0) {\n throw new Error('-: procedure require at least one argument');\n }\n typecheck_args('-', args, 'number');\n if (args.length === 1) {\n return LNumber(args[0]).sub();\n }\n if (args.length) {\n return args.reduce(binary_math_op(function(a, b) {\n return LNumber(a).sub(b);\n }));\n }\n }, `(- n1 n2 ...)\n (- n)\n\n Subtract number passed as argument. If only one argument is passed\n it will negate the value.`),\n // ------------------------------------------------------------------\n '/': doc('/', function(...args) {\n if (args.length === 0) {\n throw new Error('/: procedure require at least one argument');\n }\n typecheck_args('/', args, 'number');\n if (args.length === 1) {\n return LNumber(1).div(args[0]);\n }\n return args.reduce(binary_math_op(function(a, b) {\n return LNumber(a).div(b);\n }));\n }, `(/ n1 n2 ...)\n (/ n)\n\n Divide number passed as arguments one by one. If single argument\n is passed it will calculate (/ 1 n1).`),\n // ------------------------------------------------------------------\n abs: doc('abs', single_math_op(function(n) {\n return LNumber(n).abs();\n }), `(abs number)\n\n Function create absolute value from number.`),\n // ------------------------------------------------------------------\n truncate: doc('truncate', function(n) {\n typecheck('truncate', n, 'number');\n if (LNumber.isFloat(n)) {\n if (n instanceof LNumber) {\n n = n.valueOf();\n }\n return LFloat(truncate(n));\n }\n return n;\n }, `(truncate n)\n\n Function return integer value from real number.`),\n // ------------------------------------------------------------------\n sqrt: doc('sqrt', single_math_op(function(n) {\n return LNumber(n).sqrt();\n }), `(sqrt number)\n\n Function return square root of the number.`),\n // ------------------------------------------------------------------\n '**': doc('**', binary_math_op(function(a, b) {\n a = LNumber(a);\n b = LNumber(b);\n if (b.cmp(0) === -1) {\n return LFloat(1).div(a).pow(b.sub());\n }\n return a.pow(b);\n }), `(** a b)\n\n Function calculate number a to to the power of b.`),\n // ------------------------------------------------------------------\n '1+': doc('1+', single_math_op(function(number) {\n return LNumber(number).add(1);\n }), `(1+ number)\n\n Function add 1 to the number and return result.`),\n // ------------------------------------------------------------------\n '1-': doc(single_math_op(function(number) {\n return LNumber(number).sub(1);\n }), `(1- number)\n\n Function subtract 1 from the number and return result.`),\n // ------------------------------------------------------------------\n '%': doc('%', function(a, b) {\n typecheck_args('%', [a, b], 'number');\n return LNumber(a).rem(b);\n }, `(% n1 n2)\n\n Function get reminder of it's arguments.`),\n // ------------------------------------------------------------------\n // Booleans\n '==': doc('==', function(...args) {\n typecheck_args('==', args, 'number');\n return seq_compare((a, b) => LNumber(a).cmp(b) === 0, args);\n }, `(== x1 x2 ...)\n\n Function compare its numerical arguments and check if they are equal`),\n // ------------------------------------------------------------------\n '>': doc('>', function(...args) {\n typecheck_args('>', args, 'number');\n return seq_compare((a, b) => LNumber(a).cmp(b) === 1, args);\n }, `(> x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically increasing`),\n // ------------------------------------------------------------------\n '<': doc('<', function(...args) {\n typecheck_args('<', args, 'number');\n return seq_compare((a, b) => LNumber(a).cmp(b) === -1, args);\n }, `(< x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically decreasing`),\n // ------------------------------------------------------------------\n '<=': doc('<=', function(...args) {\n typecheck_args('<=', args, 'number');\n return seq_compare((a, b) => [0, -1].includes(LNumber(a).cmp(b)), args);\n }, `(<= x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically nonincreasing`),\n // ------------------------------------------------------------------\n '>=': doc('>=', function(...args) {\n typecheck_args('>=', args, 'number');\n return seq_compare((a, b) => [0, 1].includes(LNumber(a).cmp(b)), args);\n }, `(>= x1 x2 ...)\n\n Function compare its numerical arguments and check if they are\n monotonically nondecreasing`),\n // ------------------------------------------------------------------\n 'eq?': doc(\n 'eq?',\n equal,\n `(eq? a b)\n\n Function compare two values if they are identical.`),\n // ------------------------------------------------------------------\n or: doc(new Macro('or', function(code, { dynamic_scope, error }) {\n var args = global_env.get('list->array')(code);\n var self = this;\n if (dynamic_scope) {\n dynamic_scope = self;\n }\n if (!args.length) {\n return false;\n }\n var result;\n return (function loop() {\n function next(value) {\n result = value;\n if (result !== false) {\n return result;\n } else {\n return loop();\n }\n }\n if (!args.length) {\n if (result !== false) {\n return result;\n } else {\n return false;\n }\n } else {\n var arg = args.shift();\n var value = evaluate(arg, { env: self, dynamic_scope, error });\n return unpromise(value, next);\n }\n })();\n }), `(or . expressions)\n\n Macro execute the values one by one and return the one that is truthy value.\n If there are no expression that evaluate to true it return false.`),\n // ------------------------------------------------------------------\n and: doc(new Macro('and', function(code, { dynamic_scope, error } = {}) {\n var args = global_env.get('list->array')(code);\n var self = this;\n if (dynamic_scope) {\n dynamic_scope = self;\n }\n if (!args.length) {\n return true;\n }\n var result;\n return (function loop() {\n function next(value) {\n result = value;\n if (result === false) {\n return false;\n } else {\n return loop();\n }\n }\n if (!args.length) {\n if (result !== false) {\n return result;\n } else {\n return false;\n }\n } else {\n var arg = args.shift();\n var value = evaluate(arg, { env: self, dynamic_scope, error });\n return unpromise(value, next);\n }\n })();\n }), `(and . expressions)\n\n Macro evaluate each expression in sequence if any value return false it will\n return false. If each value return true it will return the last value.\n If it's called without arguments it will return true.`),\n // bit operations\n '|': doc('|', function(a, b) {\n return LNumber(a).or(b);\n }, `(| a b)\n\n Function calculate or bit operation.`),\n '&': doc('&', function(a, b) {\n return LNumber(a).and(b);\n }, `(& a b)\n\n Function calculate and bit operation.`),\n '~': doc('~', function(a) {\n return LNumber(a).neg();\n }, `(~ number)\n\n Function negate the value.`),\n '>>': doc('>>', function(a, b) {\n return LNumber(a).shr(b);\n }, `(>> a b)\n\n Function right shit the value a by value b.`),\n '<<': doc('<<', function(a, b) {\n return LNumber(a).shl(b);\n }, `(<< a b)\n\n Function left shit the value a by value b.`),\n not: doc('not', function not(value) {\n if (is_null(value)) {\n return true;\n }\n return !value;\n }, `(not object)\n\n Function return negation of the argument.`)\n}, undefined, 'global');\nvar user_env = global_env.inherit('user-env');\n// -------------------------------------------------------------------------\nfunction set_interaction_env(interaction, internal) {\n interaction.constant('**internal-env**', internal);\n interaction.doc(\n '**internal-env**',\n `**internal-env**\n\n Constant used to hide stdin, stdout and stderr so they don't interfere\n with variables with the same name. Constants are internal type\n of variables that can't be redefined, defining variable with same name\n will throw an error.`\n );\n global_env.set('**interaction-environment**', interaction);\n}\n// -------------------------------------------------------------------------\nset_interaction_env(user_env, internal_env);\nglobal_env.doc(\n '**interaction-environment**',\n `**interaction-environment**\n\n Internal dynamic, global variable used to find interpreter environment.\n It's used so the read and write functions can locate **internal-env**\n that contain references to stdin, stdout and stderr.`\n);\n// -------------------------------------------------------------------------\n(function() {\n var map = { ceil: 'ceiling' };\n ['floor', 'round', 'ceil'].forEach(fn => {\n var name = map[fn] ? map[fn] : fn;\n global_env.set(name, doc(name, function(value) {\n typecheck(name, value, 'number');\n if (value instanceof LNumber) {\n return value[fn]();\n }\n }, `(${name} number)\n\n Function calculate ${name} of a number.`));\n });\n})();\n// -------------------------------------------------------------------------\n// ref: https://stackoverflow.com/a/4331218/387194\nfunction allPossibleCases(arr) {\n if (arr.length === 1) {\n return arr[0];\n } else {\n var result = [];\n // recur with the rest of array\n var allCasesOfRest = allPossibleCases(arr.slice(1));\n for (var i = 0; i < allCasesOfRest.length; i++) {\n for (var j = 0; j < arr[0].length; j++) {\n result.push(arr[0][j] + allCasesOfRest[i]);\n }\n }\n return result;\n }\n}\n\n// -------------------------------------------------------------------------\nfunction combinations(input, start, end) {\n var result = [];\n for (var i = start; i <= end; ++i) {\n var input_arr = [];\n for (var j = 0; j < i; ++j) {\n input_arr.push(input);\n }\n result = result.concat(allPossibleCases(input_arr));\n }\n return result;\n}\n\n// -------------------------------------------------------------------------\n// cadr caddr cadadr etc.\ncombinations(['d', 'a'], 2, 5).forEach(spec => {\n const s = spec.split('');\n const chars = s.slice().reverse();\n const code = s.map(c => `(c${c}r`).join(' ') + ' arg' + ')'.repeat(s.length);\n const name = 'c' + spec + 'r';\n global_env.set(name, doc(name, function(arg) {\n return chars.reduce(function(list, type) {\n typecheck(name, list, 'pair');\n if (type === 'a') {\n return list.car;\n } else {\n return list.cdr;\n }\n }, arg);\n }, `(${name} arg)\n\n Function calculate ${code}`));\n});\n// -----------------------------------------------------------------------------\nfunction reversseFind(dir, fn) {\n var parts = dir.split(path.sep).filter(Boolean);\n for (var i = parts.length; i--;) {\n var p = path.join('/', ...parts.slice(0, i + 1));\n if (fn(p)) {\n return p;\n }\n }\n}\n\n// -----------------------------------------------------------------------------\nfunction nodeModuleFind(dir) {\n return reversseFind(dir, function(dir) {\n return fs.existsSync(path.join(dir, 'node_modules'));\n });\n}\n\n// -------------------------------------------------------------------------\nfunction is_node() {\n return typeof global !== 'undefined' && global.global === global;\n}\n\n// -------------------------------------------------------------------------\nasync function node_specific() {\n const { createRequire } = await import('module');\n nodeRequire = createRequire(import.meta.url);\n fs = await import('fs');\n path = await import('path');\n global_env.set('global', global);\n global_env.set('self', global);\n global_env.set('window', undefined);\n const moduleURL = new URL(import.meta.url);\n const __dirname = path.dirname(moduleURL.pathname);\n const __filename = path.basename(moduleURL.pathname);\n global_env.set('__dirname', __dirname);\n global_env.set('__filename', __filename);\n // ---------------------------------------------------------------------\n global_env.set('require.resolve', doc('require.resolve', function(path) {\n typecheck('require.resolve', path, 'string');\n var name = path.valueOf();\n return nodeRequire.resolve(name);\n }, `(require.resolve path)\n\n Return path relative the current module.`));\n // ---------------------------------------------------------------------\n global_env.set('require', doc('require', function(module) {\n typecheck('require', module, 'string');\n module = module.valueOf();\n var root = process.cwd();\n var value;\n try {\n if (module.match(/^\\s*\\./)) {\n value = nodeRequire(path.join(root, module));\n } else {\n var dir = nodeModuleFind(root);\n if (dir) {\n value = nodeRequire(path.join(dir, 'node_modules', module));\n } else {\n value = nodeRequire(module);\n }\n }\n } catch (e) {\n value = nodeRequire(module);\n }\n return patch_value(value, global);\n }, `(require module)\n\n Function to be used inside Node.js to import the module.`));\n}\n// -------------------------------------------------------------------------\nif (is_node()) {\n node_specific();\n} else if (typeof window !== 'undefined' && window === root) {\n global_env.set('window', window);\n global_env.set('global', undefined);\n global_env.set('self', window);\n} else if (typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined') {\n global_env.set('self', self);\n global_env.set('window', undefined);\n global_env.set('global', undefined);\n}\n// -------------------------------------------------------------------------\nfunction typeErrorMessage(fn, got, expected, position = null) {\n let postfix = fn ? ` in expression \\`${fn}\\`` : '';\n if (position !== null) {\n postfix += ` (argument ${position})`;\n }\n if (is_function(expected)) {\n return `Invalid type got ${got}${postfix}`;\n }\n if (expected instanceof Array) {\n if (expected.length === 1) {\n expected = expected[0];\n } else {\n const last = expected[expected.length - 1];\n expected = expected.slice(0, -1).join(', ') + ' or ' + last;\n }\n }\n return `Expecting ${expected}, got ${got}${postfix}`;\n}\n// -------------------------------------------------------------------------\nfunction typecheck_args(fn, args, expected) {\n args.forEach((arg, i) => {\n typecheck(fn, arg, expected, i + 1);\n });\n}\n// -------------------------------------------------------------------------\nfunction typecheck_text_port(fn, arg, type) {\n typecheck(fn, arg, type);\n if (arg.__type__ === binary_port) {\n throw new Error(typeErrorMessage(\n fn,\n 'binary-port',\n 'textual-port'\n ));\n }\n}\n// -------------------------------------------------------------------------\nfunction typecheck(fn, arg, expected, position = null) {\n fn = fn.valueOf();\n const arg_type = type(arg).toLowerCase();\n if (is_function(expected)) {\n if (!expected(arg)) {\n throw new Error(typeErrorMessage(fn, arg_type, expected, position));\n }\n return;\n }\n var match = false;\n if (expected instanceof Pair) {\n expected = expected.to_array();\n }\n if (expected instanceof Array) {\n expected = expected.map(x => x.valueOf());\n }\n if (expected instanceof Array) {\n expected = expected.map(x => x.valueOf().toLowerCase());\n if (expected.includes(arg_type)) {\n match = true;\n }\n } else {\n expected = expected.valueOf().toLowerCase();\n }\n if (!match && arg_type !== expected) {\n throw new Error(typeErrorMessage(fn, arg_type, expected, position));\n }\n}\n// -------------------------------------------------------------------------\nfunction self_evaluated(obj) {\n var type = typeof obj;\n return ['string', 'function'].includes(type) ||\n typeof obj === 'symbol' ||\n obj instanceof QuotedPromise ||\n obj instanceof LSymbol ||\n obj instanceof LNumber ||\n obj instanceof LString ||\n obj instanceof RegExp;\n}\n// -------------------------------------------------------------------------\nfunction is_native(obj) {\n return obj instanceof LNumber ||\n obj instanceof LString ||\n obj instanceof LCharacter;\n}\n// -------------------------------------------------------------------------\nfunction has_own_symbol(obj, symbol) {\n if (obj === null) {\n return false;\n }\n return typeof obj === 'object' &&\n symbol in Object.getOwnPropertySymbols(obj);\n}\n// -------------------------------------------------------------------------\nfunction is_iterator(obj, symbol) {\n if (has_own_symbol(obj, symbol) || has_own_symbol(obj.__proto__, symbol)) {\n return is_function(obj[symbol]);\n }\n}\n// -------------------------------------------------------------------------\nfunction type(obj) {\n var mapping = {\n 'pair': Pair,\n 'symbol': LSymbol,\n 'character': LCharacter,\n 'values': Values,\n 'input-port': InputPort,\n 'output-port': OutputPort,\n 'number': LNumber,\n 'regex': RegExp,\n 'syntax': Syntax,\n 'macro': Macro,\n 'string': LString,\n 'array': Array,\n 'native-symbol': Symbol\n };\n if (Number.isNaN(obj)) {\n return 'NaN';\n }\n if (obj === nil) {\n return 'nil';\n }\n if (obj === null) {\n return 'null';\n }\n for (let [key, value] of Object.entries(mapping)) {\n if (obj instanceof value) {\n return key;\n }\n }\n if (typeof obj === 'object') {\n if (obj.__instance__) {\n obj.__instance__ = false;\n if (obj.__instance__) {\n if (is_function(obj.toType)) {\n return obj.toType();\n }\n return 'instance';\n }\n }\n if (obj.constructor) {\n if (obj.constructor.__class__) {\n return obj.constructor.__class__;\n }\n if (obj.constructor === Object) {\n if (is_iterator(obj, Symbol.iterator)) {\n return 'iterator';\n }\n if (is_iterator(obj, Symbol.asyncIterator)) {\n return 'async-iterator';\n }\n }\n return obj.constructor.name.toLowerCase();\n }\n }\n return typeof obj;\n}\n// -------------------------------------------------------------------------\n// :; wrap tree of Promises with single Promise or return argument as is\n// :: if tree have no Promises\n// -------------------------------------------------------------------------\nfunction resolve_promises(arg) {\n var promises = [];\n traverse(arg);\n if (promises.length) {\n return resolve(arg);\n }\n return arg;\n function traverse(node) {\n if (is_promise(node)) {\n promises.push(node);\n } else if (node instanceof Pair) {\n if (!node.haveCycles('car')) {\n traverse(node.car);\n }\n if (!node.haveCycles('cdr')) {\n traverse(node.cdr);\n }\n } else if (node instanceof Array) {\n node.forEach(traverse);\n }\n }\n async function promise(node) {\n var pair = new Pair(\n node.haveCycles('car') ? node.car : await resolve(node.car),\n node.haveCycles('cdr') ? node.cdr : await resolve(node.cdr)\n );\n if (node[__data__]) {\n pair[__data__] = true;\n }\n return pair;\n }\n function resolve(node) {\n if (node instanceof Array) {\n return promise_all(node.map(resolve));\n }\n if (node instanceof Pair && promises.length) {\n return promise(node);\n }\n return node;\n }\n}\n// -------------------------------------------------------------------------\nfunction evaluate_args(rest, { env, dynamic_scope, error }) {\n var args = [];\n var node = rest;\n markCycles(node);\n function next() {\n return args;\n }\n return (function loop() {\n if (node instanceof Pair) {\n var arg = evaluate(node.car, { env, dynamic_scope, error });\n if (dynamic_scope) {\n arg = unpromise(arg, arg => {\n if (is_native_function(arg)) {\n return arg.bind(dynamic_scope);\n }\n return arg;\n });\n }\n return unpromise(resolve_promises(arg), function(arg) {\n args.push(arg);\n if (node.haveCycles('cdr')) {\n return next();\n }\n node = node.cdr;\n return loop();\n });\n } else if (node === nil) {\n return next();\n } else {\n throw new Error('Syntax Error: improper list found in apply');\n }\n })();\n}\n// -------------------------------------------------------------------------\nfunction evaluate_syntax(macro, code, eval_args) {\n var value = macro.invoke(code, eval_args);\n return unpromise(resolve_promises(value), function(value) {\n if (value instanceof Pair) {\n value.markCycles();\n }\n return quote(value);\n });\n}\n// -------------------------------------------------------------------------\nfunction evaluate_macro(macro, code, eval_args) {\n function finalize(result) {\n if (result instanceof Pair) {\n result.markCycles();\n return result;\n }\n return quote(result);\n }\n var value = macro.invoke(code, eval_args);\n return unpromise(resolve_promises(value), function ret(value) {\n if (!value || value && value[__data__] || self_evaluated(value)) {\n return value;\n } else {\n return unpromise(evaluate(value, eval_args), finalize);\n }\n });\n}\n// -------------------------------------------------------------------------\nfunction prepare_fn_args(fn, args) {\n if (is_bound(fn) && !is_object_bound(fn) &&\n (!lips_context(fn) || is_port_method(fn))) {\n args = args.map(unbox);\n }\n if (!is_raw_lambda(fn) &&\n args.some(is_lips_function) &&\n !is_lips_function(fn) &&\n !is_array_method(fn)) {\n // we unbox values from callback functions #76\n // calling map on array should not unbox the value\n var result = [], i = args.length;\n while (i--) {\n let arg = args[i];\n if (is_lips_function(arg)) {\n var wrapper = function(...args) {\n return unpromise(arg.apply(this, args), unbox);\n };\n // make wrapper work like output of bind\n hidden_prop(wrapper, '__bound__', true);\n hidden_prop(wrapper, '__fn__', arg);\n // copy prototype from function to wrapper\n // so this work when calling new from JavaScript\n // case of Preact that pass LIPS class as argument\n // to h function\n wrapper.prototype = arg.prototype;\n result[i] = wrapper;\n } else {\n result[i] = arg;\n }\n }\n args = result;\n }\n return args;\n}\n// -------------------------------------------------------------------------\nfunction apply(fn, args, { env, dynamic_scope, error = () => {} } = {}) {\n args = evaluate_args(args, { env, dynamic_scope, error });\n return unpromise(args, function(args) {\n if (is_raw_lambda(fn)) {\n // lambda need environment as context\n // normal functions are bound to their contexts\n fn = unbind(fn);\n }\n args = prepare_fn_args(fn, args);\n var _args = args.slice();\n var scope = (dynamic_scope || env).newFrame(fn, _args);\n var result = resolve_promises(fn.apply(scope, args));\n return unpromise(result, (result) => {\n if (result instanceof Pair) {\n result.markCycles();\n return quote(result);\n }\n return box(result);\n }, error);\n });\n}\n// -------------------------------------------------------------------------\n// :: Continuations object from call/cc\n// -------------------------------------------------------------------------\nclass Continuation {\n constructor(k) {\n this.__value__ = k;\n }\n invoke() {\n if (this.__value__ === null) {\n throw new Error('Continuations are not implemented yet');\n }\n }\n toString() {\n return '#';\n }\n}\n// -------------------------------------------------------------------------\nconst noop = () => {};\n// -------------------------------------------------------------------------\nfunction evaluate(code, { env, dynamic_scope, error = noop } = {}) {\n try {\n if (dynamic_scope === true) {\n env = dynamic_scope = env || global_env;\n } else if (env === true) {\n env = dynamic_scope = global_env;\n } else {\n env = env || global_env;\n }\n var eval_args = { env, dynamic_scope, error };\n var value;\n if (is_null(code)) {\n return code;\n }\n if (code instanceof LSymbol) {\n return env.get(code);\n }\n if (!(code instanceof Pair)) {\n return code;\n }\n var first = code.car;\n var rest = code.cdr;\n if (first instanceof Pair) {\n value = resolve_promises(evaluate(first, eval_args));\n if (is_promise(value)) {\n return value.then((value) => {\n return evaluate(new Pair(value, code.cdr), eval_args);\n });\n // else is later in code\n } else if (!is_callable(value)) {\n throw new Error(\n type(value) + ' ' + env.get('repr')(value) +\n ' is not callable while evaluating ' + code.toString()\n );\n }\n }\n if (first instanceof LSymbol) {\n value = env.get(first);\n } else if (is_function(first)) {\n value = first;\n }\n var result;\n if (value instanceof Syntax) {\n result = evaluate_syntax(value, code, eval_args);\n } else if (value instanceof Macro) {\n result = evaluate_macro(value, rest, eval_args);\n } else if (is_function(value)) {\n result = apply(value, rest, eval_args);\n } else if (is_continuation(value)) {\n result = value.invoke();\n } else if (code instanceof Pair) {\n value = first && first.toString();\n throw new Error(`${type(first)} ${value} is not a function`);\n } else {\n return code;\n }\n // escape promise feature #54\n var __promise__ = env.get(Symbol.for('__promise__'), { throwError: false });\n if (__promise__ === true && is_promise(result)) {\n // fix #139 evaluate the code inside the promise that is not data.\n // When promise is not quoted it happen automatically, when returning\n // promise from evaluate.\n result = result.then(result => {\n if (result instanceof Pair && !value[__data__]) {\n return evaluate(result, eval_args);\n }\n return result;\n });\n return new QuotedPromise(result);\n }\n return result;\n } catch (e) {\n error && error.call(env, e, code);\n }\n}\n// -------------------------------------------------------------------------\nconst compile = exec_collect(function(code) {\n return code;\n});\n// -------------------------------------------------------------------------\nconst exec = exec_collect(function(code, value) {\n return value;\n});\n// -------------------------------------------------------------------------\nfunction exec_collect(collect_callback) {\n return async function exec_lambda(arg, env, dynamic_scope) {\n if (dynamic_scope === true) {\n env = dynamic_scope = env || user_env;\n } else if (env === true) {\n env = dynamic_scope = user_env;\n } else {\n env = env || user_env;\n }\n var results = [];\n var input = Array.isArray(arg) ? arg : parse(arg);\n for await (let code of input) {\n const value = evaluate(code, {\n env,\n dynamic_scope,\n error: (e, code) => {\n if (e && e.message) {\n if (e.message.match(/^Error:/)) {\n var re = /^(Error:)\\s*([^:]+:\\s*)/;\n // clean duplicated Error: added by JS\n e.message = e.message.replace(re, '$1 $2');\n }\n if (code) {\n // LIPS stack trace\n if (!(e.__code__ instanceof Array)) {\n e.__code__ = [];\n }\n e.__code__.push(code.toString(true));\n }\n }\n throw e;\n }\n });\n if (!is_promise(value)) {\n results.push(collect_callback(code, value));\n } else {\n results.push(collect_callback(code, await value));\n }\n }\n return results;\n };\n}\n// -------------------------------------------------------------------------\nfunction balanced(code) {\n var maching_pairs = {\n '[': ']',\n '(': ')'\n };\n var tokens;\n if (typeof code === 'string') {\n tokens = tokenize(code);\n } else {\n tokens = code.map(x => x && x.token ? x.token : x);\n }\n\n var open_tokens = Object.keys(maching_pairs);\n var brackets = Object.values(maching_pairs).concat(open_tokens);\n tokens = tokens.filter(token => brackets.includes(token));\n\n const stack = new Stack();\n for (const token of tokens) {\n if (open_tokens.includes(token)) {\n stack.push(token);\n } else if (!stack.is_empty()) { // closing token\n var last = stack.top();\n // last on stack need to match\n const closing_token = maching_pairs[last];\n if (token === closing_token) {\n stack.pop();\n } else {\n throw new Error(`Syntax error: missing closing ${closing_token}`);\n }\n } else {\n // closing bracket without opening\n throw new Error(`Syntax error: not matched closing ${token}`);\n }\n }\n return stack.is_empty();\n}\n\n// -------------------------------------------------------------------------\nfunction fworker(fn) {\n // ref: https://stackoverflow.com/a/10372280/387194\n var str = '(' + fn.toString() + ')()';\n var URL = window.URL || window.webkitURL;\n var blob;\n try {\n blob = new Blob([str], { type: 'application/javascript' });\n } catch (e) { // Backwards-compatibility\n const BlobBuilder = window.BlobBuilder ||\n window.WebKitBlobBuilder ||\n window.MozBlobBuilder;\n blob = new BlobBuilder();\n blob.append(str);\n blob = blob.getBlob();\n }\n return new root.Worker(URL.createObjectURL(blob));\n}\n// -------------------------------------------------------------------------\nfunction is_dev() {\n return lips.version.match(/^(\\{\\{VER\\}\\}|DEV)$/);\n}\n// -------------------------------------------------------------------------\nfunction bootstrap(url = '') {\n const std = 'dist/std.xcb';\n if (url === '') {\n if (is_dev()) {\n url = `https://cdn.jsdelivr.net/gh/jcubic/lips@devel/${std}`;\n } else {\n url = `https://cdn.jsdelivr.net/npm/@jcubic/lips@${lips.version}/${std}`;\n }\n }\n var load = global_env.get('load');\n return load.call(user_env, url, global_env);\n}\n// -------------------------------------------------------------------------\nfunction Worker(url) {\n this.url = url;\n const worker = this.worker = fworker(function() {\n var interpreter;\n var init;\n // string, numbers, booleans\n self.addEventListener('message', function(response) {\n var data = response.data;\n var id = data.id;\n if (data.type !== 'RPC' || id === null) {\n return;\n }\n function send_result(result) {\n self.postMessage({ id: id, type: 'RPC', result: result });\n }\n function send_error(message) {\n self.postMessage({ id: id, type: 'RPC', error: message });\n }\n if (data.method === 'eval') {\n if (!init) {\n send_error('Worker RPC: LIPS not initialized, call init first');\n return;\n }\n init.then(function() {\n // we can use ES6 inside function that's converted to blob\n var code = data.params[0];\n var dynamic = data.params[1];\n interpreter.exec(code, dynamic).then(function(result) {\n result = result.map(function(value) {\n return value && value.valueOf();\n });\n send_result(result);\n }).catch(error => {\n send_error(error);\n });\n });\n } else if (data.method === 'init') {\n var url = data.params[0];\n if (typeof url !== 'string') {\n send_error('Worker RPC: url is not a string');\n } else {\n importScripts(`${url}/dist/lips.min.js`);\n interpreter = new lips.Interpreter('worker');\n init = bootstrap(url);\n init.then(() => {\n send_result(true);\n });\n }\n }\n });\n });\n this.rpc = (function() {\n var id = 0;\n return function rpc(method, params) {\n var _id = ++id;\n return new Promise(function(resolve, reject) {\n worker.addEventListener('message', function handler(response) {\n var data = response.data;\n if (data && data.type === 'RPC' && data.id === _id) {\n if (data.error) {\n reject(data.error);\n } else {\n resolve(data.result);\n }\n worker.removeEventListener('message', handler);\n }\n });\n worker.postMessage({\n type: 'RPC',\n method: method,\n id: _id,\n params: params\n });\n });\n };\n })();\n this.rpc('init', [url]).catch((error) => {\n console.error(error);\n });\n this.exec = function(code, dynamic = false) {\n return this.rpc('eval', [code, dynamic]);\n };\n}\n\n// -------------------------------------------------------------------------\n// :: Serialization\n// -------------------------------------------------------------------------\nvar serialization_map = {\n 'pair': ([car, cdr]) => Pair(car, cdr),\n 'number': function(value) {\n if (LString.isString(value)) {\n return LNumber([value, 10]);\n }\n return LNumber(value);\n },\n 'regex': function([pattern, flag]) {\n return new RegExp(pattern, flag);\n },\n 'nil': function() {\n return nil;\n },\n 'symbol': function(value) {\n if (LString.isString(value)) {\n return LSymbol(value);\n } else if (Array.isArray(value)) {\n return LSymbol(Symbol.for(value[0]));\n }\n },\n 'string': LString,\n 'character': LCharacter\n};\n// -------------------------------------------------------------------------\n// class mapping to create smaller JSON\nconst available_class = Object.keys(serialization_map);\nconst class_map = {};\nfor (let [i, cls] of Object.entries(available_class)) {\n class_map[cls] = +i;\n}\nfunction mangle_name(name) {\n return class_map[name];\n}\nfunction resolve_name(i) {\n return available_class[i];\n}\n// -------------------------------------------------------------------------\nfunction serialize(data) {\n return JSON.stringify(data, function(key, value) {\n const v0 = this[key];\n if (v0) {\n if (v0 instanceof RegExp) {\n return {\n '@': mangle_name('regex'),\n '#': [v0.source, v0.flags]\n };\n }\n var cls = mangle_name(v0.constructor.__class__);\n if (!is_undef(cls)) {\n return {\n '@': cls,\n '#': v0.serialize()\n };\n }\n }\n return value;\n });\n}\n// -------------------------------------------------------------------------\nfunction unserialize(string) {\n return JSON.parse(string, (_, object) => {\n if (object && typeof object === 'object') {\n if (!is_undef(object['@'])) {\n var cls = resolve_name(object['@']);\n if (serialization_map[cls]) {\n return serialization_map[cls](object['#']);\n }\n }\n }\n return object;\n });\n}\n\n// -------------------------------------------------------------------------\n// binary serialization using CBOR binary data format\n// -------------------------------------------------------------------------\nconst cbor = (function() {\n\n var types = {\n 'pair': Pair,\n 'symbol': LSymbol,\n 'number': LNumber,\n 'string': LString,\n 'character': LCharacter,\n 'nil': nil.constructor,\n 'regex': RegExp\n };\n\n function serializer(Class, fn) {\n return {\n deserialize: fn,\n Class\n };\n }\n\n var encoder = new Encoder();\n\n const cbor_serialization_map = {};\n for (const [ name, fn ] of Object.entries(serialization_map)) {\n const Class = types[name];\n cbor_serialization_map[name] = serializer(Class, fn);\n }\n // add CBOR data mapping\n let tag = 43311;\n Object.keys(cbor_serialization_map).forEach(type => {\n const data = cbor_serialization_map[type];\n if (typeof data === 'function') {\n const Class = data;\n addExtension({\n Class,\n tag,\n encode(instance, encode) {\n encode(instance.serialize());\n },\n decode(data) {\n return new Class(data);\n }\n });\n } else {\n const { deserialize, Class } = data;\n addExtension({\n Class,\n tag,\n encode(instance, encode) {\n if (instance instanceof RegExp) {\n return encode([instance.source, instance.flags]);\n }\n encode(instance.serialize());\n },\n decode(data) {\n return deserialize(data);\n }\n });\n }\n tag++;\n });\n return encoder;\n})();\n\n// -------------------------------------------------------------------------\nfunction merge_uint8_array(...args) {\n if (args.length > 1) {\n const len = args.reduce((acc, arr) => acc + arr.length, 0);\n const result = new Uint8Array(len);\n let offset = 0;\n args.forEach(item => {\n result.set(item, offset);\n offset += item.length;\n });\n return result;\n } else if (args.length) {\n return args[0];\n }\n}\n\n// -------------------------------------------------------------------------\nfunction encode_magic() {\n const VERSION = 1;\n const encoder = new TextEncoder('utf-8');\n return encoder.encode(`LIPS${VERSION.toString().padStart(3, ' ')}`);\n}\n\n// -------------------------------------------------------------------------\nconst MAGIC_LENGTH = 7;\n\n// -------------------------------------------------------------------------\nfunction decode_magic(obj) {\n const decoder = new TextDecoder('utf-8');\n const prefix = decoder.decode(obj.slice(0, MAGIC_LENGTH));\n const name = prefix.substring(0, 4);\n if (name === 'LIPS') {\n const m = prefix.match(/^(....).*([0-9]+)$/);\n if (m) {\n return {\n type: m[1],\n version: Number(m[2])\n };\n }\n }\n return {\n type: 'unknown'\n };\n}\n\n// -------------------------------------------------------------------------\nfunction serialize_bin(obj) {\n const magic = encode_magic();\n const payload = cbor.encode(obj);\n return merge_uint8_array(magic, pack(payload, { magic: false }));\n}\n\n// -------------------------------------------------------------------------\nfunction unserialize_bin(data) {\n const { type, version } = decode_magic(data);\n if (type === 'LIPS' && version === 1) {\n const arr = unpack(data.slice(MAGIC_LENGTH), { magic: false });\n return cbor.decode(arr);\n } else {\n throw new Error(`Invalid file format ${type}`);\n }\n}\n\n// -------------------------------------------------------------------------\nfunction execError(e) {\n console.error(e.message || e);\n if (e.code) {\n console.error(e.code.map((line, i) => `[${i + 1}]: ${line}`));\n }\n}\n\n// -------------------------------------------------------------------------\nfunction init() {\n var lips_mimes = ['text/x-lips', 'text/x-scheme'];\n var bootstrapped;\n function load(script) {\n return new Promise(function(resolve) {\n var src = script.getAttribute('src');\n if (src) {\n return fetch(src).then(res => res.text())\n .then(exec).then(resolve).catch((e) => {\n execError(e);\n resolve();\n });\n } else {\n return exec(script.innerHTML).then(resolve).catch((e) => {\n execError(e);\n resolve();\n });\n }\n });\n }\n\n function loop() {\n return new Promise(function(resolve) {\n var scripts = Array.from(document.querySelectorAll('script'));\n return (function loop() {\n var script = scripts.shift();\n if (!script) {\n resolve();\n } else {\n var type = script.getAttribute('type');\n if (lips_mimes.includes(type)) {\n var bootstrap_attr = script.getAttribute('bootstrap');\n if (!bootstrapped && typeof bootstrap_attr === 'string') {\n return bootstrap(bootstrap_attr).then(function() {\n return load(script, function(e) {\n console.error(e);\n });\n }).then(loop);\n } else {\n return load(script, function(e) {\n console.error(e);\n }).then(loop);\n }\n } else if (type && type.match(/lips|lisp/)) {\n console.warn('Expecting ' + lips_mimes.join(' or ') +\n ' found ' + type);\n }\n return loop();\n }\n })();\n });\n }\n if (!window.document) {\n return Promise.resolve();\n } else if (currentScript) {\n var script = currentScript;\n var bootstrap_attr = script.getAttribute('bootstrap');\n if (typeof bootstrap_attr === 'string') {\n return bootstrap(bootstrap_attr).then(function() {\n bootstrapped = true;\n return loop();\n });\n }\n }\n return loop();\n}\n// this can't be in init function, because it need to be in script context\nconst currentScript = typeof window !== 'undefined' &&\n window.document && document.currentScript;\n// -------------------------------------------------------------------------\nif (typeof window !== 'undefined') {\n contentLoaded(window, init);\n}\n// -------------------------------------------------------------------------\nvar banner = (function() {\n // Rollup tree-shaking is removing the variable if it's normal string because\n // obviously '{{DATE}}' == '{{' + 'DATE}}'; can be removed\n // but disablig Tree-shaking is adding lot of not used code so we use this\n // hack instead\n var date = LString('{{DATE}}').valueOf();\n var _date = date === '{{' + 'DATE}}' ? new Date() : new Date(date);\n var _format = x => x.toString().padStart(2, '0');\n var _year = _date.getFullYear();\n var _build = [\n _year,\n _format(_date.getMonth() + 1),\n _format(_date.getDate())\n ].join('-');\n var banner = `\n __ __ __\n / / \\\\ \\\\ _ _ ___ ___ \\\\ \\\\\n| | \\\\ \\\\ | | | || . \\\\/ __> | |\n| | > \\\\ | |_ | || _/\\\\__ \\\\ | |\n| | / ^ \\\\ |___||_||_| <___/ | |\n \\\\_\\\\ /_/ \\\\_\\\\ /_/\n\nLIPS Interpreter {{VER}} (${_build}) \nCopyright (c) 2018-${_year} Jakub T. Jankiewicz\n\nType (env) to see environment with functions macros and variables. You can also\nuse (help name) to display help for specific function or macro, (apropos name)\nto display list of matched names in environment and (dir object) to list\nproperties of an object.\n`.replace(/^.*\\n/, '');\n return banner;\n})();\n// -------------------------------------------------------------------------\n// to be used with string function when code is minified\n// -------------------------------------------------------------------------\nread_only(Ahead, '__class__', 'ahead');\nread_only(Pair, '__class__', 'pair');\nread_only(Nil, '__class__', 'nil');\nread_only(Pattern, '__class__', 'pattern');\nread_only(Formatter, '__class__', 'formatter');\nread_only(Macro, '__class__', 'macro');\nread_only(Syntax, '__class__', 'syntax');\nread_only(Environment, '__class__', 'environment');\nread_only(InputPort, '__class__', 'input-port');\nread_only(OutputPort, '__class__', 'output-port');\nread_only(BufferedOutputPort, '__class__', 'output-port');\nread_only(OutputStringPort, '__class__', 'output-string-port');\nread_only(InputStringPort, '__class__', 'input-string-port');\nread_only(InputFilePort, '__class__', 'input-file-port');\nread_only(OutputFilePort, '__class__', 'output-file-port');\nread_only(LipsError, '__class__', 'lips-error');\n[LNumber, LComplex, LRational, LFloat, LBigInteger].forEach(cls => {\n read_only(cls, '__class__', 'number');\n});\nread_only(LCharacter, '__class__', 'character');\nread_only(LSymbol, '__class__', 'symbol');\nread_only(LString, '__class__', 'string');\nread_only(QuotedPromise, '__class__', 'promise');\n// -------------------------------------------------------------------------\nconst lips = {\n version: '{{VER}}',\n banner,\n date: '{{DATE}}',\n exec,\n // unwrap async generator into Promise\n parse: compose(uniterate_async, parse),\n tokenize,\n evaluate,\n compile,\n\n serialize,\n unserialize,\n\n serialize_bin,\n unserialize_bin,\n\n bootstrap,\n\n Environment,\n env: user_env,\n\n Worker,\n\n Interpreter,\n balanced_parenthesis: balanced,\n balancedParenthesis: balanced,\n balanced,\n\n Macro,\n Syntax,\n Pair,\n Values,\n QuotedPromise,\n Error: LipsError,\n\n quote,\n\n InputPort,\n OutputPort,\n BufferedOutputPort,\n InputFilePort,\n OutputFilePort,\n InputStringPort,\n OutputStringPort,\n InputByteVectorPort,\n OutputByteVectorPort,\n InputBinaryFilePort,\n OutputBinaryFilePort,\n\n Formatter,\n Parser,\n Lexer,\n specials,\n repr,\n nil,\n eof,\n\n LSymbol,\n LNumber,\n LFloat,\n LComplex,\n LRational,\n LBigInteger,\n LCharacter,\n LString,\n rationalize\n};\n// so it work when used with webpack where it will be not global\nexport default lips;\nglobal_env.set('lips', lips);\n","export default {};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexport function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexport function normalize(path) {\n var isPathAbsolute = isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isPathAbsolute).join('/');\n\n if (!path && !isPathAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexport function isAbsolute(path) {\n return path.charAt(0) === '/';\n}\n\n// posix version\nexport function join() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n}\n\n\n// path.relative(from, to)\n// posix version\nexport function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\nexport var sep = '/';\nexport var delimiter = ':';\n\nexport function dirname(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\nexport function basename(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n}\n\n\nexport function extname(path) {\n return splitPath(path)[3];\n}\nexport default {\n extname: extname,\n basename: basename,\n dirname: dirname,\n sep: sep,\n delimiter: delimiter,\n relative: relative,\n join: join,\n isAbsolute: isAbsolute,\n normalize: normalize,\n resolve: resolve\n};\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b' ?\n function (str, start, len) { return str.substr(start, len) } :\n function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n"],"names":["_isNativeReflectConstruct","isNativeReflectConstruct","setPrototypeOf","assertThisInitialized","_arrayLikeToArray","_unsupportedIterableToArray","arrayLikeToArray","arrayWithHoles","iterableToArray","unsupportedIterableToArray","nonIterableRest","arrayWithoutHoles","nonIterableSpread","objectWithoutPropertiesLoose","iterableToArrayLimit","AwaitValue","undefined","require$$0","init","read","toString","global","position","addExtension","decodeAddExtension","encode_magic","merge_uint8_array","root","self","fetch","unfetch","fs","path","nodeRequire","BN","contentLoaded","win","fn","done","top","doc","document","documentElement","modern","addEventListener","add","rem","pre","e","type","readyState","call","poll","doScroll","setTimeout","frameElement","log","x","regex","literal","arguments","msg","is_debug","value","global_env","get","RegExp","test","console","is_promise","then","user_env","throwError","num_mnemicic_re","mnemonic","gen_rational_re","range","gen_complex_re","gen_integer_re","re_re","float_stre","complex_float_stre","float_re","make_complex_match_re","neg","fl","complex_list_re","result","forEach","radix","characters","ucs2decode","string","output","counter","length","charCodeAt","extra","push","character_symbols","Object","keys","join","char_sre_re","char_re","make_num_stre","ranges","map","m","make_type_re","complex_re","rational_re","int_re","int_bare_re","rational_bare_re","complex_bare_re","complex_bare_match_re","pre_num_parse_re","num_pre_parse","arg","parts","match","options","replace","toLowerCase","split","includes","inexact","exact","number","parse_rational","parse","num","LRational","LNumber","denom","valueOf","parse_integer","LFloat","parseInt","parse_character","char","ord","String","fromCodePoint","LCharacter","Error","parse_complex","parse_num","n","float","parse_float","toRational","NaN","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","bare_match","re","im","cmp","__type__","LComplex","is_int","parse_big_int","str","num_match","exponent","mantisa","digits","decimal_points","Math","abs","parseFloat","simple_number","factor","pow","mul","parse_string","_","hex","padStart","LString","JSON","parse_symbol","chars","t","r","chr","fromCharCode","LSymbol","parse_argument","constants","hasOwnProperty","is_atom_string","specials","names","is_symbol_string","string_re","escape_regex","special","Stack","data","prototype","item","pop","is_empty","tokens","lexer","Lexer","whitespace","token","peek","eof","skip","multiline_formatter","meta","rest","col","Thunk","cont","trampoline","args","unwind","apply","thunk","tokenize","trim","filter","strip_s_comments","s_count","s_start","remove_list","i","slice","reverse","begin","end","splice","isSymbol","name","constructor","list","__name__","Symbol","object","is","symbol","quote","symbol_to_string","is_gensym","serialize","isString","obj","gensym","count","with_props","sym","hidden_prop","QuotedPromise","promise","internal","pending","rejected","fulfilled","reason","v","read_only","hidden","is_function","err","defineProperty","enumerable","_promise","__pending__","pending_str","__rejected__","rejected_str","promise_all","Array","isArray","Promise","all","escape_quoted_promises","unescape_quoted_promises","array","escaped","Value","unescaped","LITERAL","SPLICE","SYMBOL","_specials","off","_events","on","trigger","remove","append","seq","is_special","is_builtin","builtin","is_literal","defined_specials","writable","arr","input","internals","configurable","set","_whitespace","_i","_line","_col","_newline","_state","_next","_token","_prev_char","__internal","line","offset","__input__","found","next_token","substring","len","read_rest","peek_char","skip_char","rule","prev_char","next_char","prev_re","next_re","state","match_or_null","start","loop","newline","rules","match_rule","next_state","symbol_rule","literal_rule","boundary","concat","p_re","n_re","comment","regex_class","character","bracket","b_symbol","b_comment","i_comment","l_datum","dot","_rules","_brackets","_symbol_rules","_cache","valid","sort","a","b","localeCompare","special_rules","reduce","acc","special_symbol","Parser","env","formatter","__env__","__lexer__","is_comment","_read_object","_formatter","_meta","_refs","head","nil","prev","is_close","cdr","Pair","cur","code","evaluate","error","reset","DatumReference","_resolve_object","is_plain_object","key","_resolve_pair","pair","car","builtin","extension","to_array","expr","Macro","fromArray","ref","match_datum_ref","ref_label","match_datum_label","is_open","read_list","read_value","parser","read_object","unpromise","ret","unpromise_array","unpromise_object","find","isFrozen","freeze","values","anyPromise","property","uniterate_async","matcher","dump","__doc__","trim_lines","is_lambda","previousSexp","sexp","outer","lineIndent","pattern","inner_match","get_first_match","patterns","p","not_symbol_match","match_next","next_pattern","next_input","glob","Pattern","flag","lips","inc","Formatter","__code__","defaults","indent","exceptions","shift","_options","assign","exceptions","_indent","exception_shift","settings","indexOf","regexes","s","entries","spaces","before_sexpr","last","balanced","exeption","next_tokens","Ahead","p_o","p_e","not_p","not_close","sexp_or_atom","symbols","identifiers","let_value","def_lambda_re","keywords_re","non_def","let_re","first_token_index","sub","ext","test_sexp","next","index","_spaces","format","j","lines","flatten","mutable","arrayTypeStr","nodes","node","Nil","to_object","deep","recur","typecheck","haveCycles","some","clone","visited","Map","has","__cycles__","last_pair","__data__","isNaN","is_native","fromPairs","fromObject","transform","repr","props","getOwnPropertyNames","array_methods","is_array_method","unbind","is_lips_function","user_repr","plain_object","iterator","asyncIterator","str_mapping","symbolize","getOwnPropertySymbols","o","get_props","has_own_function","function_to_string","is_native_function","__class__","instances","message","skip_cycles","pair_args","markCycles","stringify","cls","native_types","Values","InputPort","OutputPort","Environment","jQuery","is_prototype","is_iterator","seen_pairs","cycles","refs","visit","child","parents","detect","detect_thunk","mark_node","ref_nodes","__ref__","nested","prop","seq_compare","equal","y","__im__","__re__","__char__","same_atom","is_atom","source","truncate","trunc","ceil","floor","__fn__","defmacro","macro","__defmacro__","invoke","macro_expand","dynamic_scope","recur_guard","single","is_let_macro","is_procedure","proc_bindings","let_binding","is_macro","expand_let_binding","traverse","is_let","is_binding","bindings","second","Syntax","scope","lambda","define","let_macros","isNumber","__merge_env__","create","className","Parameter","extract_patterns","ellipsis_symbol","lists","expansion","pattern_names","ellipsis","list_len","code_len","IIIIII","rest_pattern","clear_gensyms","gensyms","replacement","transform_syntax","valid_symbol","n_type","first","rename","gensym_name","Boolean","transform_ellipsis_expr","caar","cadr","______","have_binding","biding","skip_nulls","every","get_names","disabled","is_spread","new_expr","bind","new_bind","is_null","is_syntax","is_undef","is_continuation","Continuation","is_callable","box","nan","map_object","descriptor","getOwnPropertyDescriptor","unbox","lips_type","patch_value","context","is_bound","bound","filter_fn_names","is_object_bound","lips_context","__context__","is_port","is_port_method","__method__","__prototype__","__lambda__","exluded_names","set_fn_length","fill","wrapper","Function","is_method","is_raw_lambda","native","let_macro","params","inherit","var_body_env","exec","promises","pararel","results","havePromises","guard_math_call","pipe","fns","f","compose","fold","limit_math_op","limit","curry","single_math_op","binary_math_op","reduce_math_op","init_args","more_args","from","__names__","__rev_names__","toUpperCase","__string__","ignore","_keys","wrap","lower","upper","force","_type","getType","types","parsable","sign","minus","BigInt","prefix","n_radix","LBigInteger","constant","complex","isComplex","rational","isRational","__value__","gcd","temp","isFloat","isNative","isBN","isInteger","isBigInteger","getArgsType","asType","isBigNumber","toNumber","matrix","bigint","integer","coerce","a_re","b_re","a_im","b_im","type_a","type_b","a_type","b_type","tmp","mapping","rev_mapping","op","_ops","_op","sqrt","exp_op","iabs","isOdd","isEven","complex_op","modulus","conjugate","div","calc","re_a","re_b","re_cmp","im_a","im_b","inf","im_str","zero_check","_minus","approxRatio","eps","gcde","_gcd","c","rationalize","simplest_rational2","fx","fy","d","__num__","__denom__","is_integer","a_denom","b_denom","a_num","b_num","_native","bn_op","text_port","_read","_with_parser","_with_init_parser","char_ready","__parser__","_make_defaults","read_line","read_char","read_string","typeErrorMessage","make_parser","close","write","_closed","flush","BufferedOutputPort","_write","_buffer","_fn","last_value","OutputStringPort","__buffer__","OutputFilePort","filename","fd","_fd","_fs","resolve","reject","__filename__","InputStringPort","InputByteVectorPort","bytevectors","binary_port","u8_ready","peek_u8","__index__","__vector__","read_u8","byte","read_u8_vector","OutputByteVectorPort","Uint8Array","_close_guard","write_u8","write_u8_vector","vector","InputFilePort","content","InputBinaryFilePort","OutputBinaryFilePort","Buffer","buffer","EOF","Interpreter","stderr","stdin","stdout","defaults_name","inter","internal_env","set_interaction_env","dynamic","LipsError","stack","parent","__docs__","__parent__","unset","newFrame","frame","parent_frame","callee","_lookup","merge","isUndefined","__values__","unshift","native_lambda","interaction","interaction_env","prompt","port","typecheck_text_port","pprint","print","display","help","cons","resolve_promises","third","slot","load","file","g_env","PATH","module_path","IS_BIN","run","unserialize_bin","unserialize","res","arrayBuffer","text","is_node","dirname","readFile","vars","body","eval_args","cond","new_code","obj_type","producer","consumer","maybe","__instance__","_args","makro_instance","get_identifiers","validate_identifiers","syntax","var_scope","lex_scope","new_env","quasiquote","is_struct","resolve_pair","eval_pair","unquoted_arr","quote_vector","unquote_cnt","max_unq","quote_object","unquote_splice","splices","Set","clear","items","is_list","nth","separator","search","instance","prepare_fn_args","valid_bare","catch_clause","finally_clause","l","pluck","typecheck_args","lcm","or","and","shr","shl","not","allPossibleCases","allCasesOfRest","combinations","input_arr","spec","repeat","reversseFind","dir","sep","nodeModuleFind","existsSync","node_specific","createRequire","import","moduleURL","URL","__dirname","pathname","__filename","basename","module","process","cwd","window","WorkerGlobalScope","got","expected","postfix","arg_type","self_evaluated","has_own_symbol","__proto__","toType","evaluate_args","evaluate_syntax","evaluate_macro","finalize","k","noop","__promise__","compile","exec_collect","collect_callback","exec_lambda","maching_pairs","open_tokens","brackets","closing_token","fworker","webkitURL","blob","Blob","BlobBuilder","WebKitBlobBuilder","MozBlobBuilder","getBlob","Worker","createObjectURL","is_dev","version","bootstrap","url","std","worker","interpreter","response","id","send_result","postMessage","send_error","method","importScripts","rpc","_id","handler","removeEventListener","serialization_map","available_class","class_map","mangle_name","resolve_name","v0","flags","cbor","serializer","Class","deserialize","encoder","Encoder","cbor_serialization_map","tag","encode","decode","VERSION","TextEncoder","MAGIC_LENGTH","decode_magic","decoder","TextDecoder","serialize_bin","magic","payload","pack","unpack","execError","lips_mimes","bootstrapped","script","src","getAttribute","innerHTML","scripts","querySelectorAll","bootstrap_attr","warn","currentScript","banner","date","_date","Date","_format","_year","getFullYear","_build","getMonth","getDate","balanced_parenthesis","balancedParenthesis"],"mappings":";;;;;;EAAe,SAAS,sBAAsB,CAAC,IAAI,EAAE;EACrD,EAAE,IAAI,IAAI,KAAK,KAAK,CAAC,EAAE;EACvB,IAAI,MAAM,IAAI,cAAc,CAAC,2DAA2D,CAAC,CAAC;EAC1F,GAAG;AACH;EACA,EAAE,OAAO,IAAI,CAAC;EACd;;ECNe,SAAS,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE;EAC9C,EAAE,eAAe,GAAG,MAAM,CAAC,cAAc,IAAI,SAAS,eAAe,C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EAC7C,KAAK;EACL,IAAI,OAAO,GAAG,CAAC;each,CAAC;AACD;EACA;EACA,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;EACpC,IAAI,UAAU,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;EAChE,IAAI,UAAU,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;EAC/B,QAAQ,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC;EAClD,QAAQ,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;EACtC,KAAK;EACL;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/dist/lips.min.js b/dist/lips.min.js
index af6e3c04c..e4d9092ff 100644
--- a/dist/lips.min.js
+++ b/dist/lips.min.js
@@ -4,7 +4,7 @@
* | | \ \ | | | || . \/ __> | |
* | | > \ | |_ | || _/\__ \ | |
* | | / ^ \ |___||_||_| <___/ | |
- * \_\ /_/ \_\ /_/ v. 1.0.0-beta.16
+ * \_\ /_/ \_\ /_/ v. DEV
*
* LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript
*
@@ -31,15 +31,15 @@
* Copyright (c) 2014-present, Facebook, Inc.
* released under MIT license
*
- * build: Mon, 15 Nov 2021 19:33:52 +0000
+ * build: Wed, 22 Nov 2023 13:53:23 +0000
*/
-(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.lips=t())})(this,function(){"use strict";function i(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t){o=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return o(e,t)}function n(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(e){return false}}function p(e,t,r){if(n()){p=Reflect.construct}else{p=function e(t,r,n){var i=[null];i.push.apply(i,r);var u=Function.bind.apply(t,i);var a=new u;if(n)o(a,n.prototype);return a}}return p.apply(null,arguments)}function u(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)o(e,t)}function _(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_=function e(t){return typeof t}}else{_=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return _(e)}function a(e,t){if(t&&(_(t)==="object"||typeof t==="function")){return t}else if(t!==void 0){throw new TypeError("Derived constructors may only return object or undefined")}return i(e)}function s(e){s=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return s(e)}function r(e){if(Array.isArray(e))return e}function t(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r=0)continue;r[i]=e[i]}return r}function D(e,t){if(e==null)return{};var r=w(e,t);var n,i;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function E(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var i=true;var u=false;var a,o;try{for(r=r.call(e);!(i=(a=r.next()).done);i=true){n.push(a.value);if(t&&n.length===t)break}}catch(e){u=true;o=e}finally{try{if(!i&&r["return"]!=null)r["return"]()}finally{if(u)throw o}}return n}function A(e,t){return r(e)||E(e,t)||f(e,t)||l()}function F(e){var t;if(typeof Symbol!=="undefined"){if(Symbol.asyncIterator)t=e[Symbol.asyncIterator];if(t==null&&Symbol.iterator)t=e[Symbol.iterator]}if(t==null)t=e["@@asyncIterator"];if(t==null)t=e["@@iterator"];if(t==null)throw new TypeError("Object is not async iterable");return t.call(e)}function x(e){this.wrapped=e}function C(e){return new x(e)}function S(u){var a,o;function e(n,i){return new Promise(function(e,t){var r={key:n,arg:i,resolve:e,reject:t,next:null};if(o){o=o.next=r}else{a=o=r;s(n,i)}})}function s(t,e){try{var r=u[t](e);var n=r.value;var i=n instanceof x;Promise.resolve(i?n.wrapped:n).then(function(e){if(i){s(t==="return"?"return":"next",e);return}c(r.done?"return":"normal",e)},function(e){s("throw",e)})}catch(e){c("throw",e)}}function c(e,t){switch(e){case"return":a.resolve({value:t,done:true});break;case"throw":a.reject(t);break;default:a.resolve({value:t,done:false});break}a=a.next;if(a){s(a.key,a.arg)}else{o=null}}this._invoke=e;if(typeof u["return"]!=="function"){this["return"]=undefined}}S.prototype[typeof Symbol==="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this};S.prototype.next=function(e){return this._invoke("next",e)};S.prototype["throw"]=function(e){return this._invoke("throw",e)};S.prototype["return"]=function(e){return this._invoke("return",e)};function e(e){return function(){return new S(e.apply(this,arguments))}}var B={exports:{}};(function(e){var t=function(a){var e=Object.prototype;var f=e.hasOwnProperty;var s;var t=typeof Symbol==="function"?Symbol:{};var i=t.iterator||"@@iterator";var r=t.asyncIterator||"@@asyncIterator";var n=t.toStringTag||"@@toStringTag";function u(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true});return e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function o(e,t,r,n){var i=t&&t.prototype instanceof c?t:c;var u=Object.create(i.prototype);var a=new O(n||[]);u._invoke=F(e,r,a);return u}a.wrap=o;function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var h="suspendedStart";var p="suspendedYield";var _="executing";var d="completed";var v={};function c(){}function m(){}function y(){}var g={};u(g,i,function(){return this});var b=Object.getPrototypeOf;var w=b&&b(b(S([])));if(w&&w!==e&&f.call(w,i)){g=w}var D=y.prototype=c.prototype=Object.create(g);m.prototype=y;u(D,"constructor",y);u(y,"constructor",m);m.displayName=u(y,n,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}a.isGeneratorFunction=function(e){var t=typeof e==="function"&&e.constructor;return t?t===m||(t.displayName||t.name)==="GeneratorFunction":false};a.mark=function(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,y)}else{e.__proto__=y;u(e,n,"GeneratorFunction")}e.prototype=Object.create(D);return e};a.awrap=function(e){return{__await:e}};function A(o,s){function c(e,t,r,n){var i=l(o[e],o,t);if(i.type==="throw"){n(i.arg)}else{var u=i.arg;var a=u.value;if(a&&typeof a==="object"&&f.call(a,"__await")){return s.resolve(a.__await).then(function(e){c("next",e,r,n)},function(e){c("throw",e,r,n)})}return s.resolve(a).then(function(e){u.value=e;r(u)},function(e){return c("throw",e,r,n)})}}var t;function e(r,n){function e(){return new s(function(e,t){c(r,n,e,t)})}return t=t?t.then(e,e):e()}this._invoke=e}E(A.prototype);u(A.prototype,r,function(){return this});a.AsyncIterator=A;a.async=function(e,t,r,n,i){if(i===void 0)i=Promise;var u=new A(o(e,t,r,n),i);return a.isGeneratorFunction(t)?u:u.next().then(function(e){return e.done?e.value:u.next()})};function F(a,o,s){var c=h;return function e(t,r){if(c===_){throw new Error("Generator is already running")}if(c===d){if(t==="throw"){throw r}return B()}s.method=t;s.arg=r;while(true){var n=s.delegate;if(n){var i=x(n,s);if(i){if(i===v)continue;return i}}if(s.method==="next"){s.sent=s._sent=s.arg}else if(s.method==="throw"){if(c===h){c=d;throw s.arg}s.dispatchException(s.arg)}else if(s.method==="return"){s.abrupt("return",s.arg)}c=_;var u=l(a,o,s);if(u.type==="normal"){c=s.done?d:p;if(u.arg===v){continue}return{value:u.arg,done:s.done}}else if(u.type==="throw"){c=d;s.method="throw";s.arg=u.arg}}}}function x(e,t){var r=e.iterator[t.method];if(r===s){t.delegate=null;if(t.method==="throw"){if(e.iterator["return"]){t.method="return";t.arg=s;x(e,t);if(t.method==="throw"){return v}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var n=l(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return v}var i=n.arg;if(!i){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return v}if(i.done){t[e.resultName]=i.value;t.next=e.nextLoc;if(t.method!=="return"){t.method="next";t.arg=s}}else{return i}t.delegate=null;return v}E(D);u(D,n,"Generator");u(D,i,function(){return this});u(D,"toString",function(){return"[object Generator]"});function C(e){var t={tryLoc:e[0]};if(1 in e){t.catchLoc=e[1]}if(2 in e){t.finallyLoc=e[2];t.afterLoc=e[3]}this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(C,this);this.reset(true)}a.keys=function(r){var n=[];for(var e in r){n.push(e)}n.reverse();return function e(){while(n.length){var t=n.pop();if(t in r){e.value=t;e.done=false;return e}}e.done=true;return e}};function S(t){if(t){var e=t[i];if(e){return e.call(t)}if(typeof t.next==="function"){return t}if(!isNaN(t.length)){var r=-1,n=function e(){while(++r=0;--t){var i=this.tryEntries[t];var u=i.completion;if(i.tryLoc==="root"){return e("end")}if(i.tryLoc<=this.prev){var a=f.call(i,"catchLoc");var o=f.call(i,"finallyLoc");if(a&&o){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&f.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e){this.complete(r.completion,r.afterLoc);k(r);return v}}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(n.type==="throw"){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){this.delegate={iterator:S(e),resultName:t,nextLoc:r};if(this.method==="next"){this.arg=s}return v}};return a}(e.exports);try{regeneratorRuntime=t}catch(e){if(typeof globalThis==="object"){globalThis.regeneratorRuntime=t}else{Function("r","regeneratorRuntime = r")(t)}}})(B);var j=B.exports;var I=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var P=[];var N=[];var R=typeof Uint8Array!=="undefined"?Uint8Array:Array;var T=false;function U(){T=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var t=0,r=e.length;t0){throw new Error("Invalid string. Length must be a multiple of 4")}u=e[o-2]==="="?2:e[o-1]==="="?1:0;a=new R(o*3/4-u);n=u>0?o-4:o;var s=0;for(t=0,r=0;t>16&255;a[s++]=i>>8&255;a[s++]=i&255}if(u===2){i=N[e.charCodeAt(t)]<<2|N[e.charCodeAt(t+1)]>>4;a[s++]=i&255}else if(u===1){i=N[e.charCodeAt(t)]<<10|N[e.charCodeAt(t+1)]<<4|N[e.charCodeAt(t+2)]>>2;a[s++]=i>>8&255;a[s++]=i&255}return a}function M(e){return P[e>>18&63]+P[e>>12&63]+P[e>>6&63]+P[e&63]}function Y(e,t,r){var n;var i=[];for(var u=t;us?s:o+a))}if(n===1){t=e[r-1];i+=P[t>>2];i+=P[t<<4&63];i+="=="}else if(n===2){t=(e[r-2]<<8)+e[r-1];i+=P[t>>10];i+=P[t>>4&63];i+=P[t<<2&63];i+="="}u.push(i);return u.join("")}function z(e,t,r,n,i){var u,a;var o=i*8-n-1;var s=(1<>1;var f=-7;var l=r?i-1:0;var h=r?-1:1;var p=e[t+l];l+=h;u=p&(1<<-f)-1;p>>=-f;f+=o;for(;f>0;u=u*256+e[t+l],l+=h,f-=8){}a=u&(1<<-f)-1;u>>=-f;f+=n;for(;f>0;a=a*256+e[t+l],l+=h,f-=8){}if(u===0){u=1-c}else if(u===s){return a?NaN:(p?-1:1)*Infinity}else{a=a+Math.pow(2,n);u=u-c}return(p?-1:1)*a*Math.pow(2,u-n)}function V(e,t,r,n,i,u){var a,o,s;var c=u*8-i-1;var f=(1<>1;var h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:u-1;var _=n?1:-1;var d=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;a=f}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(s=Math.pow(2,-a))<1){a--;s*=2}if(a+l>=1){t+=h/s}else{t+=h*Math.pow(2,1-l)}if(t*s>=2){a++;s/=2}if(a+l>=f){o=0;a=f}else if(a+l>=1){o=(t*s-1)*Math.pow(2,i);a=a+l}else{o=t*Math.pow(2,l-1)*Math.pow(2,i);a=0}}for(;i>=8;e[r+p]=o&255,p+=_,o/=256,i-=8){}a=a<0;e[r+p]=a&255,p+=_,a/=256,c-=8){}e[r+p-_]|=d*128}var J={}.toString;var G=Array.isArray||function(e){return J.call(e)=="[object Array]"};
+(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.lips=t())})(this,function(){"use strict";function i(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,t){o=Object.setPrototypeOf||function e(t,r){t.__proto__=r;return t};return o(e,t)}function n(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(e){return false}}function p(e,t,r){if(n()){p=Reflect.construct}else{p=function e(t,r,n){var i=[null];i.push.apply(i,r);var u=Function.bind.apply(t,i);var a=new u;if(n)o(a,n.prototype);return a}}return p.apply(null,arguments)}function u(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});Object.defineProperty(e,"prototype",{writable:false});if(t)o(e,t)}function _(e){"@babel/helpers - typeof";return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function a(e,t){if(t&&(_(t)==="object"||typeof t==="function")){return t}else if(t!==void 0){throw new TypeError("Derived constructors may only return object or undefined")}return i(e)}function c(e){c=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return c(e)}function r(e){if(Array.isArray(e))return e}function t(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function f(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r=0)continue;r[i]=e[i]}return r}function F(e,t){if(e==null)return{};var r=x(e,t);var n,i;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function k(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var i=true;var u=false;var a,o;try{for(r=r.call(e);!(i=(a=r.next()).done);i=true){n.push(a.value);if(t&&n.length===t)break}}catch(e){u=true;o=e}finally{try{if(!i&&r["return"]!=null)r["return"]()}finally{if(u)throw o}}return n}function j(e,t){return r(e)||k(e,t)||l(e,t)||d()}function I(e){this.wrapped=e}function P(e){return new I(e)}function N(u){var a,o;function e(n,i){return new Promise(function(e,t){var r={key:n,arg:i,resolve:e,reject:t,next:null};if(o){o=o.next=r}else{a=o=r;s(n,i)}})}function s(t,e){try{var r=u[t](e);var n=r.value;var i=n instanceof I;Promise.resolve(i?n.wrapped:n).then(function(e){if(i){s(t==="return"?"return":"next",e);return}c(r.done?"return":"normal",e)},function(e){s("throw",e)})}catch(e){c("throw",e)}}function c(e,t){switch(e){case"return":a.resolve({value:t,done:true});break;case"throw":a.reject(t);break;default:a.resolve({value:t,done:false});break}a=a.next;if(a){s(a.key,a.arg)}else{o=null}}this._invoke=e;if(typeof u["return"]!=="function"){this["return"]=undefined}}N.prototype[typeof Symbol==="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this};N.prototype.next=function(e){return this._invoke("next",e)};N.prototype["throw"]=function(e){return this._invoke("throw",e)};N.prototype["return"]=function(e){return this._invoke("return",e)};function e(e){return function(){return new N(e.apply(this,arguments))}}function R(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var T={exports:{}};var V={exports:{}};(function(e){var t=function(a){var e=Object.prototype;var f=e.hasOwnProperty;var s;var o=typeof Symbol==="function"?Symbol:{};var i=o.iterator||"@@iterator";var c=o.asyncIterator||"@@asyncIterator";var p=o.toStringTag||"@@toStringTag";function r(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true});return e[t]}try{r({},"")}catch(e){r=function(e,t,r){return e[t]=r}}function _(e,t,r,n){var i=t&&t.prototype instanceof g?t:g;var u=Object.create(i.prototype);var a=new O(n||[]);u._invoke=x(e,r,a);return u}a.wrap=_;function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var v="suspendedStart";var y="suspendedYield";var m="executing";var l="completed";var h={};function g(){}function n(){}function t(){}var b={};r(b,i,function(){return this});var w=Object.getPrototypeOf;var D=w&&w(w(S([])));if(D&&D!==e&&f.call(D,i)){b=D}var u=t.prototype=g.prototype=Object.create(b);n.prototype=t;r(u,"constructor",t);r(t,"constructor",n);n.displayName=r(t,p,"GeneratorFunction");function E(e){["next","throw","return"].forEach(function(t){r(e,t,function(e){return this._invoke(t,e)})})}a.isGeneratorFunction=function(e){var t=typeof e==="function"&&e.constructor;return t?t===n||(t.displayName||t.name)==="GeneratorFunction":false};a.mark=function(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,t)}else{e.__proto__=t;r(e,p,"GeneratorFunction")}e.prototype=Object.create(u);return e};a.awrap=function(e){return{__await:e}};function A(o,s){function c(e,t,r,n){var i=d(o[e],o,t);if(i.type==="throw"){n(i.arg)}else{var u=i.arg;var a=u.value;if(a&&typeof a==="object"&&f.call(a,"__await")){return s.resolve(a.__await).then(function(e){c("next",e,r,n)},function(e){c("throw",e,r,n)})}return s.resolve(a).then(function(e){u.value=e;r(u)},function(e){return c("throw",e,r,n)})}}var t;function e(r,n){function e(){return new s(function(e,t){c(r,n,e,t)})}return t=t?t.then(e,e):e()}this._invoke=e}E(A.prototype);r(A.prototype,c,function(){return this});a.AsyncIterator=A;a.async=function(e,t,r,n,i){if(i===void 0)i=Promise;var u=new A(_(e,t,r,n),i);return a.isGeneratorFunction(t)?u:u.next().then(function(e){return e.done?e.value:u.next()})};function x(a,o,s){var c=v;return function e(t,r){if(c===m){throw new Error("Generator is already running")}if(c===l){if(t==="throw"){throw r}return B()}s.method=t;s.arg=r;while(true){var n=s.delegate;if(n){var i=F(n,s);if(i){if(i===h)continue;return i}}if(s.method==="next"){s.sent=s._sent=s.arg}else if(s.method==="throw"){if(c===v){c=l;throw s.arg}s.dispatchException(s.arg)}else if(s.method==="return"){s.abrupt("return",s.arg)}c=m;var u=d(a,o,s);if(u.type==="normal"){c=s.done?l:y;if(u.arg===h){continue}return{value:u.arg,done:s.done}}else if(u.type==="throw"){c=l;s.method="throw";s.arg=u.arg}}}}function F(e,t){var r=e.iterator[t.method];if(r===s){t.delegate=null;if(t.method==="throw"){if(e.iterator["return"]){t.method="return";t.arg=s;F(e,t);if(t.method==="throw"){return h}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=d(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return h}var i=n.arg;if(!i){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return h}if(i.done){t[e.resultName]=i.value;t.next=e.nextLoc;if(t.method!=="return"){t.method="next";t.arg=s}}else{return i}t.delegate=null;return h}E(u);r(u,p,"Generator");r(u,i,function(){return this});r(u,"toString",function(){return"[object Generator]"});function k(e){var t={tryLoc:e[0]};if(1 in e){t.catchLoc=e[1]}if(2 in e){t.finallyLoc=e[2];t.afterLoc=e[3]}this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(k,this);this.reset(true)}a.keys=function(r){var n=[];for(var e in r){n.push(e)}n.reverse();return function e(){while(n.length){var t=n.pop();if(t in r){e.value=t;e.done=false;return e}}e.done=true;return e}};function S(t){if(t){var e=t[i];if(e){return e.call(t)}if(typeof t.next==="function"){return t}if(!isNaN(t.length)){var r=-1,n=function e(){while(++r=0;--t){var i=this.tryEntries[t];var u=i.completion;if(i.tryLoc==="root"){return e("end")}if(i.tryLoc<=this.prev){var a=f.call(i,"catchLoc");var o=f.call(i,"finallyLoc");if(a&&o){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&f.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e){this.complete(r.completion,r.afterLoc);C(r);return h}}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(n.type==="throw"){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){this.delegate={iterator:S(e),resultName:t,nextLoc:r};if(this.method==="next"){this.arg=s}return h}};return a}(e.exports);try{regeneratorRuntime=t}catch(e){if(typeof globalThis==="object"){globalThis.regeneratorRuntime=t}else{Function("r","regeneratorRuntime = r")(t)}}})(V);(function(e){e.exports=V.exports})(T);var z=R(T.exports);var $=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var J=[];var K=[];var G=typeof Uint8Array!=="undefined"?Uint8Array:Array;var H=false;function W(){H=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var t=0,r=e.length;t0){throw new Error("Invalid string. Length must be a multiple of 4")}u=e[o-2]==="="?2:e[o-1]==="="?1:0;a=new G(o*3/4-u);n=u>0?o-4:o;var s=0;for(t=0,r=0;t>16&255;a[s++]=i>>8&255;a[s++]=i&255}if(u===2){i=K[e.charCodeAt(t)]<<2|K[e.charCodeAt(t+1)]>>4;a[s++]=i&255}else if(u===1){i=K[e.charCodeAt(t)]<<10|K[e.charCodeAt(t+1)]<<4|K[e.charCodeAt(t+2)]>>2;a[s++]=i>>8&255;a[s++]=i&255}return a}function Z(e){return J[e>>18&63]+J[e>>12&63]+J[e>>6&63]+J[e&63]}function X(e,t,r){var n;var i=[];for(var u=t;us?s:o+a))}if(n===1){t=e[r-1];i+=J[t>>2];i+=J[t<<4&63];i+="=="}else if(n===2){t=(e[r-2]<<8)+e[r-1];i+=J[t>>10];i+=J[t>>4&63];i+=J[t<<2&63];i+="="}u.push(i);return u.join("")}function te(e,t,r,n,f){var i,u;var l=f*8-n-1;var h=(1<>1;var a=-7;var o=r?f-1:0;var s=r?-1:1;var c=e[t+o];o+=s;i=c&(1<<-a)-1;c>>=-a;a+=l;for(;a>0;i=i*256+e[t+o],o+=s,a-=8){}u=i&(1<<-a)-1;i>>=-a;a+=n;for(;a>0;u=u*256+e[t+o],o+=s,a-=8){}if(i===0){i=1-p}else if(i===h){return u?NaN:(c?-1:1)*Infinity}else{u=u+Math.pow(2,n);i=i-p}return(c?-1:1)*u*Math.pow(2,i-n)}function re(e,t,f,l,r,h){var n,i,u;var a=h*8-r-1;var o=(1<>1;var p=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;var c=l?0:h-1;var _=l?1:-1;var d=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){i=isNaN(t)?1:0;n=o}else{n=Math.floor(Math.log(t)/Math.LN2);if(t*(u=Math.pow(2,-n))<1){n--;u*=2}if(n+s>=1){t+=p/u}else{t+=p*Math.pow(2,1-s)}if(t*u>=2){n++;u/=2}if(n+s>=o){i=0;n=o}else if(n+s>=1){i=(t*u-1)*Math.pow(2,r);n=n+s}else{i=t*Math.pow(2,s-1)*Math.pow(2,r);n=0}}for(;r>=8;e[f+c]=i&255,c+=_,i/=256,r-=8){}n=n<0;e[f+c]=n&255,c+=_,n/=256,a-=8){}e[f+c-_]|=d*128}var ne={}.toString;var ie=Array.isArray||function(e){return ne.call(e)=="[object Array]"};
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh
* @license MIT
- */var H=50;Z.TYPED_ARRAY_SUPPORT=I.TYPED_ARRAY_SUPPORT!==undefined?I.TYPED_ARRAY_SUPPORT:true;function W(){return Z.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Q(e,t){if(W()=W()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+W().toString(16)+" bytes")}return e|0}Z.isBuffer=ze;function oe(e){return!!(e!=null&&e._isBuffer)}Z.compare=function e(t,r){if(!oe(t)||!oe(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var n=t.length;var i=r.length;for(var u=0,a=Math.min(n,i);u>>1;case"base64":return Me(e).length;default:if(n)return Le(e).length;t=(""+t).toLowerCase();n=true}}}Z.byteLength=se;function ce(e,t,r){var n=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return Fe(this,t,r);case"utf8":case"utf-8":return be(this,t,r);case"ascii":return Ee(this,t,r);case"latin1":case"binary":return Ae(this,t,r);case"base64":return ge(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}Z.prototype._isBuffer=true;function fe(e,t,r){var n=e[t];e[t]=e[r];e[r]=n}Z.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r0){t=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)t+=" ... "}return""};Z.prototype.compare=function e(t,r,n,i,u){if(!oe(t)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(n===undefined){n=t?t.length:0}if(i===undefined){i=0}if(u===undefined){u=this.length}if(r<0||n>t.length||i<0||u>this.length){throw new RangeError("out of range index")}if(i>=u&&r>=n){return 0}if(i>=u){return-1}if(r>=n){return 1}r>>>=0;n>>>=0;i>>>=0;u>>>=0;if(this===t)return 0;var a=u-i;var o=n-r;var s=Math.min(a,o);var c=this.slice(i,u);var f=t.slice(r,n);for(var l=0;l2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(i)return-1;else r=e.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof t==="string"){t=Z.from(t,n)}if(oe(t)){if(t.length===0){return-1}return he(e,t,r,n,i)}else if(typeof t==="number"){t=t&255;if(Z.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return he(e,[t],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function he(e,t,r,n,i){var u=1;var a=e.length;var o=t.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||t.length<2){return-1}u=2;a/=2;o/=2;r/=2}}function s(e,t){if(u===1){return e[t]}else{return e.readUInt16BE(t*u)}}var c;if(i){var f=-1;for(c=r;ca)r=a-o;for(c=r;c>=0;c--){var l=true;for(var h=0;hi){n=i}}var u=t.length;if(u%2!==0)throw new TypeError("Invalid hex string");if(n>u/2){n=u/2}for(var a=0;au)n=u;if(t.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var a=false;for(;;){switch(i){case"hex":return pe(this,t,r,n);case"utf8":case"utf-8":return _e(this,t,r,n);case"ascii":return de(this,t,r,n);case"latin1":case"binary":return ve(this,t,r,n);case"base64":return me(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();a=true}}};Z.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ge(e,t,r){if(t===0&&r===e.length){return $(e)}else{return $(e.slice(t,r))}}function be(e,t,r){r=Math.min(e.length,r);var n=[];var i=t;while(i239?4:u>223?3:u>191?2:1;if(i+o<=r){var s,c,f,l;switch(o){case 1:if(u<128){a=u}break;case 2:s=e[i+1];if((s&192)===128){l=(u&31)<<6|s&63;if(l>127){a=l}}break;case 3:s=e[i+1];c=e[i+2];if((s&192)===128&&(c&192)===128){l=(u&15)<<12|(s&63)<<6|c&63;if(l>2047&&(l<55296||l>57343)){a=l}}break;case 4:s=e[i+1];c=e[i+2];f=e[i+3];if((s&192)===128&&(c&192)===128&&(f&192)===128){l=(u&15)<<18|(s&63)<<12|(c&63)<<6|f&63;if(l>65535&&l<1114112){a=l}}}}if(a===null){a=65533;o=1}else if(a>65535){a-=65536;n.push(a>>>10&1023|55296);a=56320|a&1023}n.push(a);i+=o}return De(n)}var we=4096;function De(e){var t=e.length;if(t<=we){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(nn)r=n;var i="";for(var u=t;un){t=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(rr)throw new RangeError("Trying to access beyond buffer length")}Z.prototype.readUIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)Ce(t,r,this.length);var i=this[t];var u=1;var a=0;while(++a0&&(u*=256)){i+=this[t+--r]*u}return i};Z.prototype.readUInt8=function e(t,r){if(!r)Ce(t,1,this.length);return this[t]};Z.prototype.readUInt16LE=function e(t,r){if(!r)Ce(t,2,this.length);return this[t]|this[t+1]<<8};Z.prototype.readUInt16BE=function e(t,r){if(!r)Ce(t,2,this.length);return this[t]<<8|this[t+1]};Z.prototype.readUInt32LE=function e(t,r){if(!r)Ce(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};Z.prototype.readUInt32BE=function e(t,r){if(!r)Ce(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};Z.prototype.readIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)Ce(t,r,this.length);var i=this[t];var u=1;var a=0;while(++a=u)i-=Math.pow(2,8*r);return i};Z.prototype.readIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n)Ce(t,r,this.length);var i=r;var u=1;var a=this[t+--i];while(i>0&&(u*=256)){a+=this[t+--i]*u}u*=128;if(a>=u)a-=Math.pow(2,8*r);return a};Z.prototype.readInt8=function e(t,r){if(!r)Ce(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};Z.prototype.readInt16LE=function e(t,r){if(!r)Ce(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};Z.prototype.readInt16BE=function e(t,r){if(!r)Ce(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};Z.prototype.readInt32LE=function e(t,r){if(!r)Ce(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};Z.prototype.readInt32BE=function e(t,r){if(!r)Ce(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};Z.prototype.readFloatLE=function e(t,r){if(!r)Ce(t,4,this.length);return z(this,t,true,23,4)};Z.prototype.readFloatBE=function e(t,r){if(!r)Ce(t,4,this.length);return z(this,t,false,23,4)};Z.prototype.readDoubleLE=function e(t,r){if(!r)Ce(t,8,this.length);return z(this,t,true,52,8)};Z.prototype.readDoubleBE=function e(t,r){if(!r)Ce(t,8,this.length);return z(this,t,false,52,8)};function ke(e,t,r,n,i,u){if(!oe(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}Z.prototype.writeUIntLE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var u=Math.pow(2,8*n)-1;ke(this,t,r,n,u,0)}var a=1;var o=0;this[r]=t&255;while(++o=0&&(o*=256)){this[r+a]=t/o&255}return r+n};Z.prototype.writeUInt8=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,1,255,0);if(!Z.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function Oe(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,u=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}Z.prototype.writeUInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,2,65535,0);if(Z.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{Oe(this,t,r,true)}return r+2};Z.prototype.writeUInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,2,65535,0);if(Z.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{Oe(this,t,r,false)}return r+2};function Se(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,u=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}Z.prototype.writeUInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,4,4294967295,0);if(Z.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{Se(this,t,r,true)}return r+4};Z.prototype.writeUInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,4,4294967295,0);if(Z.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{Se(this,t,r,false)}return r+4};Z.prototype.writeIntLE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var u=Math.pow(2,8*n-1);ke(this,t,r,n,u-1,-u)}var a=0;var o=1;var s=0;this[r]=t&255;while(++a>0)-s&255}return r+n};Z.prototype.writeIntBE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var u=Math.pow(2,8*n-1);ke(this,t,r,n,u-1,-u)}var a=n-1;var o=1;var s=0;this[r+a]=t&255;while(--a>=0&&(o*=256)){if(t<0&&s===0&&this[r+a+1]!==0){s=1}this[r+a]=(t/o>>0)-s&255}return r+n};Z.prototype.writeInt8=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,1,127,-128);if(!Z.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};Z.prototype.writeInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,2,32767,-32768);if(Z.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{Oe(this,t,r,true)}return r+2};Z.prototype.writeInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,2,32767,-32768);if(Z.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{Oe(this,t,r,false)}return r+2};Z.prototype.writeInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,4,2147483647,-2147483648);if(Z.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{Se(this,t,r,true)}return r+4};Z.prototype.writeInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)ke(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(Z.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{Se(this,t,r,false)}return r+4};function Be(e,t,r,n,i,u){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function je(e,t,r,n,i){if(!i){Be(e,t,r,4)}V(e,t,r,n,23,4);return r+4}Z.prototype.writeFloatLE=function e(t,r,n){return je(this,t,r,true,n)};Z.prototype.writeFloatBE=function e(t,r,n){return je(this,t,r,false,n)};function Ie(e,t,r,n,i){if(!i){Be(e,t,r,8)}V(e,t,r,n,52,8);return r+8}Z.prototype.writeDoubleLE=function e(t,r,n){return Ie(this,t,r,true,n)};Z.prototype.writeDoubleBE=function e(t,r,n){return Ie(this,t,r,false,n)};Z.prototype.copy=function e(t,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(t.length-r=0;--a){t[a+r]=this[a+n]}}else if(u<1e3||!Z.TYPED_ARRAY_SUPPORT){for(a=0;a>>0;n=n===undefined?this.length:n>>>0;if(!t)t=0;var a;if(typeof t==="number"){for(a=r;a55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)u.push(239,191,189);continue}else if(a+1===n){if((t-=3)>-1)u.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)u.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)u.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return u}function Ue(e){var t=[];for(var r=0;r>8;i=r%256;u.push(i);u.push(n)}return u}function Me(e){return q(Ne(e))}function Ye(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function $e(e){return e!==e}function ze(e){return e!=null&&(!!e._isBuffer||Ve(e)||Je(e))}function Ve(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function Je(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&Ve(e.slice(0,0))}let Ge;try{Ge=new TextDecoder}catch(e){}let He;let We;let Qe=0;const Ze=105;const Ke={};let Xe={};let et;let tt;let rt=0;let nt=0;let it;let ut=[];let at;let ot;let st={useRecords:false,mapsAsObjects:true};let ct=false;class ft{constructor(e){if(e){if(e.useRecords===false&&e.mapsAsObjects===undefined)e.mapsAsObjects=true;if(e.getStructures&&!e.structures)(e.structures=[]).uninitialized=true}Object.assign(this,e)}decode(e,t){if(He){return Bt(()=>{jt();return this?this.decode(e,t):ft.prototype.decode.call(st,e,t)})}We=t>-1?t:e.length;Qe=0;nt=0;tt=null;He=e;at=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength));if(this){Xe=this;if(this.structures){et=this.structures;return lt()}else if(!et||et.length>0){et=[]}}else{Xe=st;if(!et||et.length>0)et=[]}return lt()}decodeMultiple(r,n){let i,u=0;try{let e=r.length;ct=true;let t=this?this.decode(r,e):Nt.decode(r,e);if(n){n(t);while(QeWe){let e=new Error("Unexpected end of CBOR data");e.incomplete=true;throw e}else if(!ct){throw new Error("Data read, but end of buffer not reached")}return e}catch(e){jt();if(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")){e.incomplete=true}throw e}}function ht(){let r=He[Qe++];let i=r>>5;r=r&31;if(r>23){switch(r){case 24:r=He[Qe++];break;case 25:if(i==7){return Dt()}r=at.getUint16(Qe);Qe+=2;break;case 26:if(i==7){let t=at.getFloat32(Qe);if(Xe.useFloat32>2){let e=Pt[(He[Qe]&127)<<1|He[Qe+1]>>7];Qe+=4;return(e*t+(t>0?.5:-.5)>>0)/e}Qe+=4;return t}r=at.getUint32(Qe);Qe+=4;break;case 27:if(i==7){let e=at.getFloat64(Qe);Qe+=8;return e}if(Xe.uint64AsNumber)return He[Qe++]*72057594037927940+He[Qe++]*281474976710656+He[Qe++]*1099511627776+He[Qe++]*4294967296+He[Qe++]*16777216+(He[Qe++]<<16)+(He[Qe++]<<8)+He[Qe++];r=at.getBigUint64(Qe);Qe+=8;break;case 31:switch(i){case 2:case 3:case 4:let e=[];let t,r=0;while((t=ht())!=Ke){e[r++]=t}return i==4?e:i==3?e.join(""):Z.concat(e);case 5:let n;if(Xe.mapsAsObjects){let e={};while((n=At())!=Ke)e[n]=ht();return e}else{if(ot){Xe.mapsAsObjects=true;ot=false}let e=new Map;while((n=ht())!=Ke)e.set(n,ht());return e}case 7:return Ke;default:throw new Error("Invalid major type for indefinite length "+i)}default:throw new Error("Unknown token "+r)}}switch(i){case 0:return r;case 1:return~r;case 2:return wt(r);case 3:if(nt>=Qe){return tt.slice(Qe-rt,(Qe+=r)-rt)}if(nt==0&&We<140&&r<32){let e=r<16?bt(r):gt(r);if(e!=null)return e}return vt(r);case 4:let t=new Array(r);for(let e=0;e>8==Ze){let t=et[r&255];if(t){if(!t.read)t.read=_t(t);return t.read()}else if(Xe.getStructures){let e=Bt(()=>{He=null;return Xe.getStructures()});if(et===true)Xe.structures=et=e;else et.splice.apply(et,[0,e.length].concat(e));t=et[r&255];if(t){if(!t.read)t.read=_t(t);return t.read()}else return r}else return r}else{let e=ut[r];if(e){if(e.handlesRead)return e(ht);else return e(ht())}else return new Ft(ht())}case 7:switch(r){case 20:return false;case 21:return true;case 22:return null;case 23:return;case 31:default:throw new Error("Unknown token "+r)}default:if(isNaN(r)){let e=new Error("Unexpected end of CBOR data");e.incomplete=true;throw e}throw new Error("Unknown CBOR token "+r)}}const pt=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function _t(n){let e=n.length;function t(){if(t.count++>2){this.read=new Function("a","r","return function(){a();return {"+n.map(e=>pt.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()").join(",")+"}}")(dt,ht);return this.read()}dt();let r={};for(let t=0;t23){switch(t){case 24:Qe++;break;case 25:Qe+=2;break;case 26:Qe+=4}}}let vt=mt;function mt(e){let t;if(e<16){if(t=bt(e))return t}if(e>64&&Ge)return Ge.decode(He.subarray(Qe,Qe+=e));const r=Qe+e;const n=[];t="";while(Qe65535){e-=65536;n.push(e>>>10&1023|55296);e=56320|e&1023}n.push(e)}else{n.push(i)}if(n.length>=4096){t+=yt.apply(String,n);n.length=0}}if(n.length>0){t+=yt.apply(String,n)}return t}let yt=String.fromCharCode;function gt(t){let r=Qe;let n=new Array(t);for(let e=0;e0){Qe=r;return}n[e]=i}return yt.apply(String,n)}function bt(d){if(d<4){if(d<2){if(d===0)return"";else{let e=He[Qe++];if((e&128)>1){Qe-=1;return}return yt(e)}}else{let e=He[Qe++];let t=He[Qe++];if((e&128)>0||(t&128)>0){Qe-=2;return}if(d<3)return yt(e,t);let r=He[Qe++];if((r&128)>0){Qe-=3;return}return yt(e,t,r)}}else{let l=He[Qe++];let h=He[Qe++];let p=He[Qe++];let _=He[Qe++];if((l&128)>0||(h&128)>0||(p&128)>0||(_&128)>0){Qe-=4;return}if(d<6){if(d===4)return yt(l,h,p,_);else{let e=He[Qe++];if((e&128)>0){Qe-=5;return}return yt(l,h,p,_,e)}}else if(d<8){let e=He[Qe++];let t=He[Qe++];if((e&128)>0||(t&128)>0){Qe-=6;return}if(d<7)return yt(l,h,p,_,e,t);let r=He[Qe++];if((r&128)>0){Qe-=7;return}return yt(l,h,p,_,e,t,r)}else{let o=He[Qe++];let s=He[Qe++];let c=He[Qe++];let f=He[Qe++];if((o&128)>0||(s&128)>0||(c&128)>0||(f&128)>0){Qe-=8;return}if(d<10){if(d===8)return yt(l,h,p,_,o,s,c,f);else{let e=He[Qe++];if((e&128)>0){Qe-=9;return}return yt(l,h,p,_,o,s,c,f,e)}}else if(d<12){let e=He[Qe++];let t=He[Qe++];if((e&128)>0||(t&128)>0){Qe-=10;return}if(d<11)return yt(l,h,p,_,o,s,c,f,e,t);let r=He[Qe++];if((r&128)>0){Qe-=11;return}return yt(l,h,p,_,o,s,c,f,e,t,r)}else{let n=He[Qe++];let i=He[Qe++];let u=He[Qe++];let a=He[Qe++];if((n&128)>0||(i&128)>0||(u&128)>0||(a&128)>0){Qe-=12;return}if(d<14){if(d===12)return yt(l,h,p,_,o,s,c,f,n,i,u,a);else{let e=He[Qe++];if((e&128)>0){Qe-=13;return}return yt(l,h,p,_,o,s,c,f,n,i,u,a,e)}}else{let e=He[Qe++];let t=He[Qe++];if((e&128)>0||(t&128)>0){Qe-=14;return}if(d<15)return yt(l,h,p,_,o,s,c,f,n,i,u,a,e,t);let r=He[Qe++];if((r&128)>0){Qe-=15;return}return yt(l,h,p,_,o,s,c,f,n,i,u,a,e,t,r)}}}}}function wt(e){return Xe.copyBuffers?Uint8Array.prototype.slice.call(He,Qe,Qe+=e):He.subarray(Qe,Qe+=e)}function Dt(){let e=He[Qe++];let t=He[Qe++];let r=(e<<8)+t;let n=r>>10&31;let i=r&1023;let u;if(n==0)u=Math.exp(i,-24);else if(n!=31)u=Math.exp(i+1024,n-25);else u=i==0?Infinity:NaN;return r&32768?-u:u}let Et=new Array(4096);function At(){let e=He[Qe++];if(e>=96&&e<120){e=e-96;if(nt>=Qe)return tt.slice(Qe-rt,(Qe+=e)-rt);else if(!(nt==0&&We<180))return vt(e)}else{Qe--;return ht()}let t=(e<<5^(e>1?at.getUint16(Qe):e>0?He[Qe]:0))&4095;let r=Et[t];let n=Qe;let i=Qe+e-3;let u;let a=0;if(r&&r.bytes==e){while(n{return new Date(e)};ut[1]=e=>{return new Date(e*1e3)};ut[2]=e=>{return new DataView(e.buffer,e.byteOffset,e.byteLength).getBigUint64(0)};ut[3]=e=>{return BigInt(-1)-new DataView(e.buffer,e.byteOffset,e.byteLength).getBigUint64(0)};const Ct=()=>{let r=ht();let n=r[0];let e=r[1];et[e&255]=n;n.read=_t(n);let i={};for(let t=2,e=r.length;t{return(xt[e[0]]||Error)(e[1],e[2])};ut[40009]=e=>{if(!it)it=new Map;let t=He[Qe];let r;if(t>>5==4)r=[];else r={};let n={target:r};it.set(e,n);let i=ht();if(n.used)return Object.assign(r,i);n.target=i;return i};ut[40010]=e=>{let t=it.get(e);t.used=true;return t.target};ut[258]=e=>new Set(e);(ut[259]=e=>{if(Xe.mapsAsObjects){Xe.mapsAsObjects=false;ot=true}return e()}).handlesRead=true;const kt=["Uint8","Uint8Clamped","Uint16","Uint32","BigUint64","Int8","Int16","Int32","BigInt64","Float32","Float64"].map(e=>e+"Array");const Ot=[64,68,69,70,71,72,77,78,79,81,82];for(let e=0;e{if(!t)throw new Error("Could not find typed array for code "+typeCode);return new xt[t](Uint8Array.prototype.slice.call(e,0).buffer)}}function Bt(e){let t=We;let r=Qe;let n=rt;let i=nt;let u=tt;let a=it;let o=new Uint8Array(He.slice(0,We));let s=et;let c=Xe;let f=ct;let l=e();We=t;Qe=r;rt=n;nt=i;tt=u;it=a;He=o;ct=f;et=s;Xe=c;at=new DataView(He.buffer,He.byteOffset,He.byteLength);return l}function jt(){He=null;it=null;et=null}function It(e){ut[e.tag]=e.decode}let Pt=new Array(147);for(let e=0;e<256;e++){Pt[e]=+("1e"+Math.floor(45.15-e*.30103))}let Nt=new ft({useRecords:false});Nt.decode;Nt.decodeMultiple;let Rt;try{Rt=new TextEncoder}catch(e){}let Tt,Lt;const Ut=typeof Z!=="undefined";const qt=Ut?Z.allocUnsafeSlow:Uint8Array;const Mt=Ut?Z:Uint8Array;const Yt=105;const $t=256;const zt=Ut?4294967296:2144337920;let Vt;let Jt;let Gt=0;let Ht;const Wt=Symbol("record-id");class Qt extends ft{constructor(e){super(e);this.offset=0;let i;let o;let s;let c;let r;let n=0;let t=Mt.prototype.utf8Write?function(e,t,r){return Vt.utf8Write(e,t,r)}:Rt&&Rt.encodeInto?function(e,t){return Rt.encodeInto(e,Vt.subarray(t)).written}:false;let u=this;let f=64;let a=e&&e.sequential;if(a){f=0;this.structures=[]}let l=[];let h=0;let p=0;if(this.structures&&this.structures.length>f){throw new Error("Too many shared structures")}this.encode=function(e){if(!Vt){Vt=new qt(8192);Jt=new DataView(Vt.buffer,0,8192);Gt=0}Ht=Vt.length-10;if(Ht-Gt<2048){Vt=new qt(Vt.length);Jt=new DataView(Vt.buffer,0,Vt.length);Ht=Vt.length-10;Gt=0}i=Gt;r=u.structuredClone?new Map:null;o=u.structures;if(o){if(o.uninitialized)u.structures=o=u.getStructures();let t=o.length;if(t>f&&!a)t=f;if(!o.transitions){o.transitions=Object.create(null);for(let e=0;eHt)v(Gt);u.offset=Gt;let e=er(Vt.subarray(i,Gt),r.idsToInsert);r=null;return e}return Vt.subarray(i,Gt)}finally{if(o){if(p<10)p++;if(h>1e4){o.transitions=null;p=0;h=0;if(l.length>0)l=[]}else if(l.length>0&&!a){for(let e=0,t=l.length;ef){u.structures=u.structures.slice(0,f)}if(u.saveStructures(u.structures,n)===false){u.structures=u.getStructures()||[];return u.encode(e)}n=u.structures.length}}}};const _=a=>{if(Gt>Ht)Vt=v(Gt);var e=typeof a;var o;if(e==="string"){let i=a.length;let u;if(i<32){u=1}else if(i<256){u=2}else if(i<65536){u=3}else{u=5}let e=i*3;if(Gt+e>Ht)Vt=v(Gt+e);if(i<64||!t){let e,t,r,n=Gt+u;for(e=0;e>6|192;Vt[n++]=t&63|128}else if((t&64512)===55296&&((r=a.charCodeAt(e+1))&64512)===56320){t=65536+((t&1023)<<10)+(r&1023);e++;Vt[n++]=t>>18|240;Vt[n++]=t>>12&63|128;Vt[n++]=t>>6&63|128;Vt[n++]=t&63|128}else{Vt[n++]=t>>12|224;Vt[n++]=t>>6&63|128;Vt[n++]=t&63|128}}o=n-Gt-u}else{o=t(a,Gt+u,e)}if(o<24){Vt[Gt++]=96|o}else if(o<256){if(u<2){Vt.copyWithin(Gt+2,Gt+1,Gt+1+o)}Vt[Gt++]=120;Vt[Gt++]=o}else if(o<65536){if(u<3){Vt.copyWithin(Gt+3,Gt+2,Gt+2+o)}Vt[Gt++]=121;Vt[Gt++]=o>>8;Vt[Gt++]=o&255}else{if(u<5){Vt.copyWithin(Gt+5,Gt+3,Gt+3+o)}Vt[Gt++]=122;Jt.setUint32(Gt,o);Gt+=4}Gt+=o}else if(e==="number"){if(a>>>0===a){if(a<24){Vt[Gt++]=a}else if(a<256){Vt[Gt++]=24;Vt[Gt++]=a}else if(a<65536){Vt[Gt++]=25;Vt[Gt++]=a>>8;Vt[Gt++]=a&255}else{Vt[Gt++]=26;Jt.setUint32(Gt,a);Gt+=4}}else if(a>>0===a){if(a>=-24){Vt[Gt++]=31-a}else if(a>=-256){Vt[Gt++]=56;Vt[Gt++]=~a}else if(a>=-65536){Vt[Gt++]=57;Jt.setUint16(Gt,~a);Gt+=2}else{Vt[Gt++]=58;Jt.setUint32(Gt,~a);Gt+=4}}else{let t;if((t=this.useFloat32)>0&&a<4294967296&&a>=-2147483648){Vt[Gt++]=250;Jt.setFloat32(Gt,a);let e;if(t<4||(e=a*Pt[(Vt[Gt]&127)<<1|Vt[Gt+1]>>7])>>0===e){Gt+=4;return}else Gt--}Vt[Gt++]=251;Jt.setFloat64(Gt,a);Gt+=8}}else if(e==="object"){if(!a)Vt[Gt++]=246;else{if(r){let t=r.get(a);if(t){if(!t.id){let e=r.idsToInsert||(r.idsToInsert=[]);t.id=e.push(t)}Vt[Gt++]=217;Vt[Gt++]=40010>>8;Vt[Gt++]=40010&255;Vt[Gt++]=26;Jt.setUint32(Gt,t.id);Gt+=4;return}else r.set(a,{offset:Gt-i})}let e=a.constructor;if(e===Object){d(a,true)}else if(e===Array){o=a.length;if(o<24){Vt[Gt++]=128|o}else{Zt(o)}for(let e=0;e>8;Vt[Gt++]=o&255}else{Vt[Gt++]=186;Jt.setUint32(Gt,o);Gt+=4}for(let[e,t]of a){_(e);_(t)}}else{for(let r=0,e=Tt.length;r>8;Vt[Gt++]=t&255}else if(t>-1){Vt[Gt++]=218;Jt.setUint32(Gt,t);Gt+=4}e.encode.call(this,a,_,v);return}}if(a[Symbol.iterator]){Vt[Gt++]=159;for(let e of a){_(e)}Vt[Gt++]=255;return}d(a,!a.hasOwnProperty)}}}else if(e==="boolean"){Vt[Gt++]=a?245:244}else if(e==="bigint"){if(a=0){Vt[Gt++]=27;Jt.setBigUint64(Gt,a)}else if(a>-(BigInt(1)<{let r=Object.keys(t);let n=r.length;if(n<24){Vt[Gt++]=160|n}else if(n<256){Vt[Gt++]=184;Vt[Gt++]=n}else if(n<65536){Vt[Gt++]=185;Vt[Gt++]=n>>8;Vt[Gt++]=n&255}else{Vt[Gt++]=186;Jt.setUint32(Gt,n);Gt+=4}let i;for(let e=0;e{Vt[Gt++]=185;let e=Gt-i;Gt+=2;let n=0;for(let e in t){if(r||t.hasOwnProperty(e)){_(e);_(t[e]);n++}}Vt[e+++i]=n>>8;Vt[e+i]=n&255}:t=>{let r=Object.keys(t);let n,i=c.transitions||(c.transitions=Object.create(null));let u=0;let a=r.length;for(let t=0;t=$t){c.nextId=(e=f)+1}i[Wt]=e;c[e]=r;if(o&&o.length<=f){Vt[Gt++]=217;Vt[Gt++]=Yt;Vt[Gt++]=e;s=true}else{Vt[Gt++]=216;Vt[Gt++]=Yt;if(u)h+=p*u;if(l.length>=$t-f)l.shift()[Wt]=undefined;l.push(i);if(a<22)Vt[Gt++]=130+a;else Zt(a+2);_(r);Vt[Gt++]=25;Vt[Gt++]=Yt;Vt[Gt++]=e;for(let e=0;e {let t;if(e>16777216){if(e-i>zt)throw new Error("Encoded buffer would be larger than maximum buffer size");t=Math.min(zt,Math.round(Math.max((e-i)*(e>67108864?1.25:2),16777216)/4096)*4096)}else t=(Math.max(e-i<<2,Vt.length-1)>>12)+1<<12;let r=new qt(t);Jt=new DataView(r.buffer,0,t);if(Vt.copy)Vt.copy(r,0,i,e);else r.set(Vt.slice(i,e));Gt-=i;i=0;Ht=r.length-10;return Vt=r}}useBuffer(e){Vt=e;Jt=new DataView(Vt.buffer,Vt.byteOffset,Vt.byteLength);Gt=0}}function Zt(e){if(e<256){Vt[Gt++]=152;Vt[Gt++]=e}else if(e<65536){Vt[Gt++]=153;Vt[Gt++]=e>>8;Vt[Gt++]=e&255}else{Vt[Gt++]=154;Jt.setUint32(Gt,e);Gt+=4}}Lt=[Date,Set,Error,RegExp,ArrayBuffer,Mt,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,BigUint64Array,Int8Array,Int16Array,Int32Array,BigInt64Array,Float32Array,Float64Array];Tt=[{tag:1,encode(e,t){let r=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&r>=0&&r<4294967296){Vt[Gt++]=26;Jt.setUint32(Gt,r);Gt+=4}else{Vt[Gt++]=251;Jt.setFloat64(Gt,r);Gt+=8}}},{tag:258,encode(e,t){let r=Array.from(e);t(r)}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t(["RegExp",e.source,e.flags])}},{encode(e,t,r){Xt(e,r)}},{encode(e,t,r){Xt(e,r)}},Kt(64),Kt(68),Kt(69),Kt(70),Kt(71),Kt(72),Kt(77),Kt(78),Kt(79),Kt(81),Kt(82)];function Kt(e){return{tag:e,encode:function e(t,r){let n=t.byteLength;let i=t.byteOffset||0;let u=t.buffer||t;r(Ut?Z.from(u,i,n):new Uint8Array(u,i,n))}}}function Xt(e,t){let r=e.byteLength;if(r<24){Vt[Gt++]=64+r}else if(r<256){Vt[Gt++]=88;Vt[Gt++]=r}else if(r<65536){Vt[Gt++]=89;Vt[Gt++]=r>>8;Vt[Gt++]=r&255}else{Vt[Gt++]=90;Jt.setUint32(Gt,r);Gt+=4}if(Gt+r>=Vt.length){t(Gt+r)}Vt.set(e,Gt);Gt+=r}function er(n,e){let i;let u=e.length*8;let a=n.length-u;e.sort((e,t)=>e.offset>t.offset?1:-1);while(i=e.pop()){let e=i.offset;let t=i.id;n.copyWithin(e+u,e,a);u-=8;let r=e+u;n[r++]=217;n[r++]=40009>>8;n[r++]=40009&255;n[r++]=26;n[r++]=t>>24;n[r++]=t>>16&255;n[r++]=t>>8&255;n[r++]=t&255;a=e}return n}function tr(e){if(e.Class){if(!e.encode)throw new Error("Extension has no encode function");Lt.unshift(e.Class);Tt.unshift(e)}It(e)}let rr=new Qt({useRecords:false});rr.encode;var nr={};
+ */var ue=50;se.TYPED_ARRAY_SUPPORT=$.TYPED_ARRAY_SUPPORT!==undefined?$.TYPED_ARRAY_SUPPORT:true;ae();function ae(){return se.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function oe(e,t){if(ae()=ae()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+ae().toString(16)+" bytes")}return e|0}se.isBuffer=tt;function me(e){return!!(e!=null&&e._isBuffer)}se.compare=function e(t,r){if(!me(t)||!me(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var n=t.length;var i=r.length;for(var u=0,a=Math.min(n,i);u>>1;case"base64":return Ze(e).length;default:if(n)return He(e).length;t=(""+t).toLowerCase();n=true}}}se.byteLength=ge;function be(e,t,r){var n=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return Re(this,t,r);case"utf8":case"utf-8":return Be(this,t,r);case"ascii":return Pe(this,t,r);case"latin1":case"binary":return Ne(this,t,r);case"base64":return Se(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}se.prototype._isBuffer=true;function we(e,t,r){var n=e[t];e[t]=e[r];e[r]=n}se.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r0){t=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)t+=" ... "}return""};se.prototype.compare=function f(e,t,r,n,i){if(!me(e)){throw new TypeError("Argument must be a Buffer")}if(t===undefined){t=0}if(r===undefined){r=e?e.length:0}if(n===undefined){n=0}if(i===undefined){i=this.length}if(t<0||r>e.length||n<0||i>this.length){throw new RangeError("out of range index")}if(n>=i&&t>=r){return 0}if(n>=i){return-1}if(t>=r){return 1}t>>>=0;r>>>=0;n>>>=0;i>>>=0;if(this===e)return 0;var u=i-n;var a=r-t;var l=Math.min(u,a);var o=this.slice(n,i);var s=e.slice(t,r);for(var c=0;c2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(i)return-1;else r=e.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof t==="string"){t=se.from(t,n)}if(me(t)){if(t.length===0){return-1}return Ee(e,t,r,n,i)}else if(typeof t==="number"){t=t&255;if(se.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return Ee(e,[t],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function Ee(e,t,r,n,f){var i=1;var u=e.length;var a=t.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||t.length<2){return-1}i=2;u/=2;a/=2;r/=2}}function o(e,t){if(i===1){return e[t]}else{return e.readUInt16BE(t*i)}}var s;if(f){var c=-1;for(s=r;su)r=u-a;for(s=r;s>=0;s--){var l=true;for(var h=0;hi){n=i}}var u=t.length;if(u%2!==0)throw new TypeError("Invalid hex string");if(n>u/2){n=u/2}for(var a=0;au)n=u;if(t.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var a=false;for(;;){switch(i){case"hex":return Ae(this,t,r,n);case"utf8":case"utf-8":return xe(this,t,r,n);case"ascii":return Fe(this,t,r,n);case"latin1":case"binary":return ke(this,t,r,n);case"base64":return Ce(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();a=true}}};se.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Se(e,t,r){if(t===0&&r===e.length){return ee(e)}else{return ee(e.slice(t,r))}}function Be(e,f,t){t=Math.min(e.length,t);var r=[];var n=f;while(n239?4:i>223?3:i>191?2:1;if(n+a<=t){var o,s,l,c;switch(a){case 1:if(i<128){u=i}break;case 2:o=e[n+1];if((o&192)===128){c=(i&31)<<6|o&63;if(c>127){u=c}}break;case 3:o=e[n+1];s=e[n+2];if((o&192)===128&&(s&192)===128){c=(i&15)<<12|(o&63)<<6|s&63;if(c>2047&&(c<55296||c>57343)){u=c}}break;case 4:o=e[n+1];s=e[n+2];l=e[n+3];if((o&192)===128&&(s&192)===128&&(l&192)===128){c=(i&15)<<18|(o&63)<<12|(s&63)<<6|l&63;if(c>65535&&c<1114112){u=c}}}}if(u===null){u=65533;a=1}else if(u>65535){u-=65536;r.push(u>>>10&1023|55296);u=56320|u&1023}r.push(u);n+=a}return Ie(r)}var je=4096;function Ie(e){var t=e.length;if(t<=je){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(nn)r=n;var i="";for(var u=t;un){t=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(rr)throw new RangeError("Trying to access beyond buffer length")}se.prototype.readUIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)Le(t,r,this.length);var i=this[t];var u=1;var a=0;while(++a0&&(u*=256)){i+=this[t+--r]*u}return i};se.prototype.readUInt8=function e(t,r){if(!r)Le(t,1,this.length);return this[t]};se.prototype.readUInt16LE=function e(t,r){if(!r)Le(t,2,this.length);return this[t]|this[t+1]<<8};se.prototype.readUInt16BE=function e(t,r){if(!r)Le(t,2,this.length);return this[t]<<8|this[t+1]};se.prototype.readUInt32LE=function e(t,r){if(!r)Le(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};se.prototype.readUInt32BE=function e(t,r){if(!r)Le(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};se.prototype.readIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)Le(t,r,this.length);var i=this[t];var u=1;var a=0;while(++a=u)i-=Math.pow(2,8*r);return i};se.prototype.readIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n)Le(t,r,this.length);var i=r;var u=1;var a=this[t+--i];while(i>0&&(u*=256)){a+=this[t+--i]*u}u*=128;if(a>=u)a-=Math.pow(2,8*r);return a};se.prototype.readInt8=function e(t,r){if(!r)Le(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};se.prototype.readInt16LE=function e(t,r){if(!r)Le(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};se.prototype.readInt16BE=function e(t,r){if(!r)Le(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};se.prototype.readInt32LE=function e(t,r){if(!r)Le(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};se.prototype.readInt32BE=function e(t,r){if(!r)Le(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};se.prototype.readFloatLE=function e(t,r){if(!r)Le(t,4,this.length);return te(this,t,true,23,4)};se.prototype.readFloatBE=function e(t,r){if(!r)Le(t,4,this.length);return te(this,t,false,23,4)};se.prototype.readDoubleLE=function e(t,r){if(!r)Le(t,8,this.length);return te(this,t,true,52,8)};se.prototype.readDoubleBE=function e(t,r){if(!r)Le(t,8,this.length);return te(this,t,false,52,8)};function Ue(e,t,r,n,i,u){if(!me(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}se.prototype.writeUIntLE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var u=Math.pow(2,8*n)-1;Ue(this,t,r,n,u,0)}var a=1;var o=0;this[r]=t&255;while(++o=0&&(o*=256)){this[r+a]=t/o&255}return r+n};se.prototype.writeUInt8=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,1,255,0);if(!se.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function Me(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,u=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}se.prototype.writeUInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,2,65535,0);if(se.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{Me(this,t,r,true)}return r+2};se.prototype.writeUInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,2,65535,0);if(se.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{Me(this,t,r,false)}return r+2};function qe(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,u=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}se.prototype.writeUInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,4,4294967295,0);if(se.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{qe(this,t,r,true)}return r+4};se.prototype.writeUInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,4,4294967295,0);if(se.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{qe(this,t,r,false)}return r+4};se.prototype.writeIntLE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var u=Math.pow(2,8*n-1);Ue(this,t,r,n,u-1,-u)}var a=0;var o=1;var s=0;this[r]=t&255;while(++a>0)-s&255}return r+n};se.prototype.writeIntBE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var u=Math.pow(2,8*n-1);Ue(this,t,r,n,u-1,-u)}var a=n-1;var o=1;var s=0;this[r+a]=t&255;while(--a>=0&&(o*=256)){if(t<0&&s===0&&this[r+a+1]!==0){s=1}this[r+a]=(t/o>>0)-s&255}return r+n};se.prototype.writeInt8=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,1,127,-128);if(!se.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};se.prototype.writeInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,2,32767,-32768);if(se.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{Me(this,t,r,true)}return r+2};se.prototype.writeInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,2,32767,-32768);if(se.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{Me(this,t,r,false)}return r+2};se.prototype.writeInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,4,2147483647,-2147483648);if(se.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{qe(this,t,r,true)}return r+4};se.prototype.writeInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)Ue(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(se.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{qe(this,t,r,false)}return r+4};function Ye(e,t,r,n,i,u){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ve(e,t,r,n,i){if(!i){Ye(e,t,r,4)}re(e,t,r,n,23,4);return r+4}se.prototype.writeFloatLE=function e(t,r,n){return Ve(this,t,r,true,n)};se.prototype.writeFloatBE=function e(t,r,n){return Ve(this,t,r,false,n)};function ze(e,t,r,n,i){if(!i){Ye(e,t,r,8)}re(e,t,r,n,52,8);return r+8}se.prototype.writeDoubleLE=function e(t,r,n){return ze(this,t,r,true,n)};se.prototype.writeDoubleBE=function e(t,r,n){return ze(this,t,r,false,n)};se.prototype.copy=function e(t,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(t.length-r=0;--a){t[a+r]=this[a+n]}}else if(u<1e3||!se.TYPED_ARRAY_SUPPORT){for(a=0;a>>0;n=n===undefined?this.length:n>>>0;if(!t)t=0;var a;if(typeof t==="number"){for(a=r;a55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)u.push(239,191,189);continue}else if(a+1===n){if((t-=3)>-1)u.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)u.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)u.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return u}function We(e){var t=[];for(var r=0;r>8;i=r%256;u.push(i);u.push(n)}return u}function Ze(e){return Q(Je(e))}function Xe(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function et(e){return e!==e}function tt(e){return e!=null&&(!!e._isBuffer||rt(e)||nt(e))}function rt(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function nt(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&rt(e.slice(0,0))}let it;try{it=new TextDecoder}catch(e){}let ut;let at;let v=0;const ot=105;const st=57342;const ct=57343;const ft=57337;const lt=6;const ht={};let pt={};let _t;let dt;let vt=0;let yt=0;let mt;let gt;let bt=[];let wt=[];let Dt;let Et;let At;let xt={useRecords:false,mapsAsObjects:true};let Ft=false;let kt=2;try{new Function("")}catch(e){kt=Infinity}class Ct{constructor(r){if(r){if((r.keyMap||r._keyMap)&&!r.useRecords){r.useRecords=false;r.mapsAsObjects=true}if(r.useRecords===false&&r.mapsAsObjects===undefined)r.mapsAsObjects=true;if(r.getStructures)r.getShared=r.getStructures;if(r.getShared&&!r.structures)(r.structures=[]).uninitialized=true;if(r.keyMap){this.mapKey=new Map;for(let[e,t]of Object.entries(r.keyMap))this.mapKey.set(t,e)}}Object.assign(this,r)}decodeKey(e){return this.keyMap?this.mapKey.get(e)||e:e}encodeKey(e){return this.keyMap&&this.keyMap.hasOwnProperty(e)?this.keyMap[e]:e}encodeKeys(r){if(!this._keyMap)return r;let n=new Map;for(let[e,t]of Object.entries(r))n.set(this._keyMap.hasOwnProperty(e)?this._keyMap[e]:e,t);return n}decodeKeys(e){if(!this._keyMap||e.constructor.name!="Map")return e;if(!this._mapKey){this._mapKey=new Map;for(let[e,t]of Object.entries(this._keyMap))this._mapKey.set(t,e)}let r={};e.forEach((e,t)=>r[It(this._mapKey.has(t)?this._mapKey.get(t):t)]=e);return r}mapDecode(e,t){let r=this.decode(e);if(this._keyMap){switch(r.constructor.name){case"Array":return r.map(e=>this.decodeKeys(e))}}return r}decode(t,e){if(ut){return nr(()=>{ir();return this?this.decode(t,e):Ct.prototype.decode.call(xt,t,e)})}at=e>-1?e:t.length;v=0;yt=0;dt=null;mt=null;ut=t;try{Et=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(e){ut=null;if(t instanceof Uint8Array)throw e;throw new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof Ct){pt=this;Dt=this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues);if(this.structures){_t=this.structures;return Ot()}else if(!_t||_t.length>0){_t=[]}}else{pt=xt;if(!_t||_t.length>0)_t=[];Dt=null}return Ot()}decodeMultiple(r,n){let i,u=0;try{let e=r.length;Ft=true;let t=this?this.decode(r,e):or.decode(r,e);if(n){if(n(t)===false){return}while(v=mt.postBundlePosition){let e=new Error("Unexpected bundle position");e.incomplete=true;throw e}v=mt.postBundlePosition;mt=null}if(v==at){_t=null;ut=null;if(gt)gt=null}else if(v>at){let e=new Error("Unexpected end of CBOR data");e.incomplete=true;throw e}else if(!Ft){throw new Error("Data read, but end of buffer not reached")}return e}catch(e){ir();if(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")){e.incomplete=true}throw e}}function St(){let n=ut[v++];let i=n>>5;n=n&31;if(n>23){switch(n){case 24:n=ut[v++];break;case 25:if(i==7){return Yt()}n=Et.getUint16(v);v+=2;break;case 26:if(i==7){let t=Et.getFloat32(v);if(pt.useFloat32>2){let e=ar[(ut[v]&127)<<1|ut[v+1]>>7];v+=4;return(e*t+(t>0?.5:-.5)>>0)/e}v+=4;return t}n=Et.getUint32(v);v+=4;break;case 27:if(i==7){let e=Et.getFloat64(v);v+=8;return e}if(i>1){if(Et.getUint32(v)>0)throw new Error("JavaScript does not support arrays, maps, or strings with length over 4294967295");n=Et.getUint32(v+4)}else if(pt.int64AsNumber){n=Et.getUint32(v)*4294967296;n+=Et.getUint32(v+4)}else n=Et.getBigUint64(v);v+=8;break;case 31:switch(i){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4:let e=[];let t,r=0;while((t=St())!=ht){e[r++]=t}return i==4?e:i==3?e.join(""):se.concat(e);case 5:let n;if(pt.mapsAsObjects){let e={};if(pt.keyMap)while((n=St())!=ht)e[It(pt.decodeKey(n))]=St();else while((n=St())!=ht)e[It(n)]=St();return e}else{if(At){pt.mapsAsObjects=true;At=false}let e=new Map;if(pt.keyMap)while((n=St())!=ht)e.set(pt.decodeKey(n),St());else while((n=St())!=ht)e.set(n,St());return e}case 7:return ht;default:throw new Error("Invalid major type for indefinite length "+i)}default:throw new Error("Unknown token "+n)}}switch(i){case 0:return n;case 1:return~n;case 2:return Ut(n);case 3:if(yt>=v){return dt.slice(v-vt,(v+=n)-vt)}if(yt==0&&at<140&&n<32){let e=n<16?Lt(n):Tt(n);if(e!=null)return e}return Pt(n);case 4:let t=new Array(n);for(let e=0;e=ft){let e=_t[n&8191];if(e){if(!e.read)e.read=jt(e);return e.read()}if(n<65536){if(n==ct){let e=tr();let t=St();let r=St();zt(t,r);let n={};if(pt.keyMap)for(let t=2;t23){switch(t){case 24:t=ut[v++];break;case 25:t=Et.getUint16(v);v+=2;break;case 26:t=Et.getUint32(v);v+=4;break;default:throw new Error("Expected array header, but got "+ut[v-1])}}let r=this.compiledReader;while(r){if(r.propertyCount===t)return r(St);r=r.next}if(this.slowReads++>=kt){let e=this.length==t?this:this.slice(0,t);r=pt.keyMap?new Function("r","return {"+e.map(e=>pt.decodeKey(e)).map(e=>Bt.test(e)?It(e)+":r()":"["+JSON.stringify(e)+"]:r()").join(",")+"}"):new Function("r","return {"+e.map(e=>Bt.test(e)?It(e)+":r()":"["+JSON.stringify(e)+"]:r()").join(",")+"}");if(this.compiledReader)r.next=this.compiledReader;r.propertyCount=t;this.compiledReader=r;return r(St)}let n={};if(pt.keyMap)for(let e=0;e64&&it)return it.decode(ut.subarray(v,v+=e));const r=v+e;const n=[];t="";while(v65535){e-=65536;n.push(e>>>10&1023|55296);e=56320|e&1023}n.push(e)}else{n.push(i)}if(n.length>=4096){t+=Rt.apply(String,n);n.length=0}}if(n.length>0){t+=Rt.apply(String,n)}return t}let Rt=String.fromCharCode;function Tt(t){let r=v;let n=new Array(t);for(let e=0;e0){v=r;return}n[e]=i}return Rt.apply(String,n)}function Lt(d){if(d<4){if(d<2){if(d===0)return"";else{let e=ut[v++];if((e&128)>1){v-=1;return}return Rt(e)}}else{let e=ut[v++];let t=ut[v++];if((e&128)>0||(t&128)>0){v-=2;return}if(d<3)return Rt(e,t);let r=ut[v++];if((r&128)>0){v-=3;return}return Rt(e,t,r)}}else{let l=ut[v++];let h=ut[v++];let p=ut[v++];let _=ut[v++];if((l&128)>0||(h&128)>0||(p&128)>0||(_&128)>0){v-=4;return}if(d<6){if(d===4)return Rt(l,h,p,_);else{let e=ut[v++];if((e&128)>0){v-=5;return}return Rt(l,h,p,_,e)}}else if(d<8){let e=ut[v++];let t=ut[v++];if((e&128)>0||(t&128)>0){v-=6;return}if(d<7)return Rt(l,h,p,_,e,t);let r=ut[v++];if((r&128)>0){v-=7;return}return Rt(l,h,p,_,e,t,r)}else{let o=ut[v++];let s=ut[v++];let c=ut[v++];let f=ut[v++];if((o&128)>0||(s&128)>0||(c&128)>0||(f&128)>0){v-=8;return}if(d<10){if(d===8)return Rt(l,h,p,_,o,s,c,f);else{let e=ut[v++];if((e&128)>0){v-=9;return}return Rt(l,h,p,_,o,s,c,f,e)}}else if(d<12){let e=ut[v++];let t=ut[v++];if((e&128)>0||(t&128)>0){v-=10;return}if(d<11)return Rt(l,h,p,_,o,s,c,f,e,t);let r=ut[v++];if((r&128)>0){v-=11;return}return Rt(l,h,p,_,o,s,c,f,e,t,r)}else{let n=ut[v++];let i=ut[v++];let u=ut[v++];let a=ut[v++];if((n&128)>0||(i&128)>0||(u&128)>0||(a&128)>0){v-=12;return}if(d<14){if(d===12)return Rt(l,h,p,_,o,s,c,f,n,i,u,a);else{let e=ut[v++];if((e&128)>0){v-=13;return}return Rt(l,h,p,_,o,s,c,f,n,i,u,a,e)}}else{let e=ut[v++];let t=ut[v++];if((e&128)>0||(t&128)>0){v-=14;return}if(d<15)return Rt(l,h,p,_,o,s,c,f,n,i,u,a,e,t);let r=ut[v++];if((r&128)>0){v-=15;return}return Rt(l,h,p,_,o,s,c,f,n,i,u,a,e,t,r)}}}}}function Ut(e){return pt.copyBuffers?Uint8Array.prototype.slice.call(ut,v,v+=e):ut.subarray(v,v+=e)}let Mt=new Float32Array(1);let qt=new Uint8Array(Mt.buffer,0,4);function Yt(){let t=ut[v++];let r=ut[v++];let e=(t&127)>>2;if(e===31){if(r||t&3)return NaN;return t&128?-Infinity:Infinity}if(e===0){let e=((t&3)<<8|r)/(1<<24);return t&128?-e:e}qt[3]=t&128|(e>>1)+56;qt[2]=(t&7)<<5|r>>3;qt[1]=r<<5;qt[0]=0;return Mt[0]}new Array(4096);class Vt{constructor(e,t){this.value=e;this.tag=t}}bt[0]=e=>{return new Date(e)};bt[1]=e=>{return new Date(Math.round(e*1e3))};bt[2]=r=>{let n=BigInt(0);for(let e=0,t=r.byteLength;e{return BigInt(-1)-bt[2](e)};bt[4]=e=>{return+(e[1]+"e"+e[0])};bt[5]=e=>{return e[1]*Math.exp(e[0]*Math.log(2))};const zt=(e,t)=>{e=e-57344;let r=_t[e];if(r&&r.isShared){(_t.restoreStructures||(_t.restoreStructures=[]))[e]=r}_t[e]=t;t.read=jt(t)};bt[ot]=r=>{let e=r.length;let n=r[1];zt(r[0],n);let i={};for(let t=2;t{if(mt)return mt[0].slice(mt.position0,mt.position0+=e);return new Vt(e,14)};bt[15]=e=>{if(mt)return mt[1].slice(mt.position1,mt.position1+=e);return new Vt(e,15)};let $t={Error:Error,RegExp:RegExp};bt[27]=e=>{return($t[e[0]]||Error)(e[1],e[2])};const Jt=e=>{if(ut[v++]!=132)throw new Error("Packed values structure must be followed by a 4 element array");let t=e();Dt=Dt?t.concat(Dt.slice(t.length)):t;Dt.prefixes=e();Dt.suffixes=e();return e()};Jt.handlesRead=true;bt[51]=Jt;bt[lt]=e=>{if(!Dt){if(pt.getShared)rr();else return new Vt(e,lt)}if(typeof e=="number")return Dt[16+(e>=0?2*e:-2*e-1)];throw new Error("No support for non-integer packed references yet")};bt[28]=e=>{if(!gt){gt=new Map;gt.id=0}let t=gt.id++;let r=ut[v];let n;if(r>>5==4)n=[];else n={};let i={target:n};gt.set(t,i);let u=e();if(i.used)return Object.assign(n,u);i.target=u;return u};bt[28].handlesRead=true;bt[29]=e=>{let t=gt.get(e);t.used=true;return t.target};bt[258]=e=>new Set(e);(bt[259]=e=>{if(pt.mapsAsObjects){pt.mapsAsObjects=false;At=true}return e()}).handlesRead=true;function Kt(e,t){if(typeof e==="string")return e+t;if(e instanceof Array)return e.concat(t);return Object.assign({},e,t)}function Gt(){if(!Dt){if(pt.getShared)rr();else throw new Error("No packed values available")}return Dt}const Ht=1399353956;wt.push((e,t)=>{if(e>=225&&e<=255)return Kt(Gt().prefixes[e-224],t);if(e>=28704&&e<=32767)return Kt(Gt().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return Kt(Gt().prefixes[e-1879048192],t);if(e>=216&&e<=223)return Kt(t,Gt().suffixes[e-216]);if(e>=27647&&e<=28671)return Kt(t,Gt().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return Kt(t,Gt().suffixes[e-1811939328]);if(e==Ht){return{packedValues:Dt,structures:_t.slice(0),version:t}}if(e==55799)return t});const Wt=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;const Qt=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array=="undefined"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array=="undefined"?{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array];const Zt=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e{if(!o)throw new Error("Could not find typed array for code "+s);return new o(Uint8Array.prototype.slice.call(e,0).buffer)}:e=>{if(!o)throw new Error("Could not find typed array for code "+s);let t=new DataView(e.buffer,e.byteOffset,e.byteLength);let r=e.length>>u;let n=new o(r);let i=t[c];for(let e=0;e23){switch(e){case 24:e=ut[v++];break;case 25:e=Et.getUint16(v);v+=2;break;case 26:e=Et.getUint32(v);v+=4;break}}return e}function rr(){if(pt.getShared){let e=nr(()=>{ut=null;return pt.getShared()})||{};let t=e.structures||[];pt.sharedVersion=e.version;Dt=pt.sharedValues=e.packedValues;if(_t===true)pt.structures=_t=t;else _t.splice.apply(_t,[0,t.length].concat(t))}}function nr(e){let t=at;let r=v;let n=vt;let i=yt;let u=dt;let a=gt;let o=mt;let s=new Uint8Array(ut.slice(0,at));let c=_t;let f=pt;let l=Ft;let h=e();at=t;v=r;vt=n;yt=i;dt=u;gt=a;mt=o;ut=s;Ft=l;_t=c;pt=f;Et=new DataView(ut.buffer,ut.byteOffset,ut.byteLength);return h}function ir(){ut=null;gt=null;_t=null}function ur(e){bt[e.tag]=e.decode}const ar=new Array(147);for(let e=0;e<256;e++){ar[e]=+("1e"+Math.floor(45.15-e*.30103))}let or=new Ct({useRecords:false});or.decode;or.decodeMultiple;let sr;try{sr=new TextEncoder}catch(e){}let cr,fr;const lr=typeof globalThis==="object"&&globalThis.Buffer;const hr=typeof lr!=="undefined";const pr=hr?lr.allocUnsafeSlow:Uint8Array;const _r=hr?lr:Uint8Array;const dr=256;const vr=hr?4294967296:2144337920;let yr;let O;let mr;let S=0;let gr;let br=null;const wr=61440;const Dr=/[\u0080-\uFFFF]/;const Er=Symbol("record-id");class Ar extends Ct{constructor(r){super(r);this.offset=0;let s;let a;let _;let f;let n;r=r||{};let c=_r.prototype.utf8Write?function(e,t,r){return O.utf8Write(e,t,r)}:sr&&sr.encodeInto?function(e,t){return sr.encodeInto(e,O.subarray(t)).written}:false;let u=this;let e=r.structures||r.saveStructures;let l=r.maxSharedStructures;if(l==null)l=e?128:0;if(l>8190)throw new Error("Maximum maxSharedStructure is 8190");let o=r.sequential;if(o){l=0}if(!this.structures)this.structures=[];if(this.saveStructures)this.saveShared=this.saveStructures;let d,v,y=r.sharedValues;let i;if(y){i=Object.create(null);for(let e=0,t=y.length;ethis.encodeKeys(e));break}}return this.encode(e,t)};this.encode=function(t,e){if(!O){O=new pr(8192);mr=new DataView(O.buffer,0,8192);S=0}gr=O.length-10;if(gr-S<2048){O=new pr(O.length);mr=new DataView(O.buffer,0,O.length);gr=O.length-10;S=0}else if(e===Lr)S=S+7&2147483640;s=S;if(u.useSelfDescribedHeader){mr.setUint32(S,3654940416);S+=3}n=u.structuredClone?new Map:null;if(u.bundleStrings&&typeof t!=="string"){br=[];br.size=Infinity}else br=null;a=u.structures;if(a){if(a.uninitialized){let e=u.getShared()||{};u.structures=a=e.structures||[];u.sharedVersion=e.version;let r=u.sharedValues=e.packedValues;if(r){i={};for(let e=0,t=r.length;el&&!o)e=l;if(!a.transitions){a.transitions=Object.create(null);for(let u=0;u0){O[S++]=216;O[S++]=51;kr(4);let r=e.values;p(r);kr(0);kr(0);v=Object.create(i||null);for(let e=0,t=r.length;egr)w(S);u.offset=S;let e=Pr(O.subarray(s,S),n.idsToInsert);n=null;return e}if(e&Lr){O.start=s;O.end=S;return O}return O.subarray(s,S)}finally{if(a){if(g<10)g++;if(a.length>l)a.length=l;if(m>1e4){a.transitions=null;g=0;m=0;if(h.length>0)h=[]}else if(h.length>0&&!o){for(let e=0,t=h.length;el){u.structures=u.structures.slice(0,l)}let e=O.subarray(s,S);if(u.updateSharedData()===false)return u.encode(t);return e}if(e&Ur)S=s}};this.findCommonStringsToPack=()=>{d=new Map;if(!i)i=Object.create(null);return e=>{let r=e&&e.threshold||4;let n=this.pack?e.maxPrivatePackedValues||16:0;if(!y)y=this.sharedValues=[];for(let[e,t]of d){if(t.count>r){i[e]=n++;y.push(e);_=true}}while(this.saveShared&&this.updateSharedData()===false){}d=null}};const p=a=>{if(S>gr)O=w(S);var e=typeof a;var o;if(e==="string"){if(v){let e=v[a];if(e>=0){if(e<16)O[S++]=e+224;else{O[S++]=198;if(e&1)p(15-e>>1);else p(e-16>>1)}return}else if(d&&!r.pack){let e=d.get(a);if(e)e.count++;else d.set(a,{count:1})}}let i=a.length;if(br&&i>=4&&i<1024){if((br.size+=i)>wr){let e;let t=(br[0]?br[0].length*3+br[1].length:0)+10;if(S+t>gr)O=w(S+t);O[S++]=217;O[S++]=223;O[S++]=249;O[S++]=br.position?132:130;O[S++]=26;e=S-s;S+=4;if(br.position){Nr(s,p)}br=["",""];br.size=0;br.position=e}let e=Dr.test(a);br[e?0:1]+=a;O[S++]=e?206:207;p(i);return}let u;if(i<32){u=1}else if(i<256){u=2}else if(i<65536){u=3}else{u=5}let e=i*3;if(S+e>gr)O=w(S+e);if(i<64||!c){let e,t,r,n=S+u;for(e=0;e>6|192;O[n++]=t&63|128}else if((t&64512)===55296&&((r=a.charCodeAt(e+1))&64512)===56320){t=65536+((t&1023)<<10)+(r&1023);e++;O[n++]=t>>18|240;O[n++]=t>>12&63|128;O[n++]=t>>6&63|128;O[n++]=t&63|128}else{O[n++]=t>>12|224;O[n++]=t>>6&63|128;O[n++]=t&63|128}}o=n-S-u}else{o=c(a,S+u,e)}if(o<24){O[S++]=96|o}else if(o<256){if(u<2){O.copyWithin(S+2,S+1,S+1+o)}O[S++]=120;O[S++]=o}else if(o<65536){if(u<3){O.copyWithin(S+3,S+2,S+2+o)}O[S++]=121;O[S++]=o>>8;O[S++]=o&255}else{if(u<5){O.copyWithin(S+5,S+3,S+3+o)}O[S++]=122;mr.setUint32(S,o);S+=4}S+=o}else if(e==="number"){if(!this.alwaysUseFloat&&a>>>0===a){if(a<24){O[S++]=a}else if(a<256){O[S++]=24;O[S++]=a}else if(a<65536){O[S++]=25;O[S++]=a>>8;O[S++]=a&255}else{O[S++]=26;mr.setUint32(S,a);S+=4}}else if(!this.alwaysUseFloat&&a>>0===a){if(a>=-24){O[S++]=31-a}else if(a>=-256){O[S++]=56;O[S++]=~a}else if(a>=-65536){O[S++]=57;mr.setUint16(S,~a);S+=2}else{O[S++]=58;mr.setUint32(S,~a);S+=4}}else{let t;if((t=this.useFloat32)>0&&a<4294967296&&a>=-2147483648){O[S++]=250;mr.setFloat32(S,a);let e;if(t<4||(e=a*ar[(O[S]&127)<<1|O[S+1]>>7])>>0===e){S+=4;return}else S--}O[S++]=251;mr.setFloat64(S,a);S+=8}}else if(e==="object"){if(!a)O[S++]=246;else{if(n){let t=n.get(a);if(t){O[S++]=216;O[S++]=29;O[S++]=25;if(!t.references){let e=n.idsToInsert||(n.idsToInsert=[]);t.references=[];e.push(t)}t.references.push(S-s);S+=2;return}else n.set(a,{offset:S-s})}let e=a.constructor;if(e===Object){b(a,true)}else if(e===Array){o=a.length;if(o<24){O[S++]=128|o}else{kr(o)}for(let e=0;e>8;O[S++]=o&255}else{O[S++]=186;mr.setUint32(S,o);S+=4}if(u.keyMap){for(let[e,t]of a){p(u.encodeKey(e));p(t)}}else{for(let[e,t]of a){p(e);p(t)}}}else{for(let r=0,e=cr.length;r>8;O[S++]=t&255}else if(t>-1){O[S++]=218;mr.setUint32(S,t);S+=4}e.encode.call(this,a,p,w);return}}if(a[Symbol.iterator]){if(yr){let e=new Error("Iterable should be serialized as iterator");e.iteratorNotHandled=true;throw e}O[S++]=159;for(let e of a){p(e)}O[S++]=255;return}if(a[Symbol.asyncIterator]||Or(a)){let e=new Error("Iterable/blob should be serialized as iterator");e.iteratorNotHandled=true;throw e}if(this.useToJSON&&a.toJSON){const t=a.toJSON();if(t!==a)return p(t)}b(a,!a.hasOwnProperty)}}}else if(e==="boolean"){O[S++]=a?245:244}else if(e==="bigint"){if(a=0){O[S++]=27;mr.setBigUint64(S,a)}else if(a>-(BigInt(1)<{let t=Object.keys(e);let r=Object.values(e);let n=t.length;if(n<24){O[S++]=160|n}else if(n<256){O[S++]=184;O[S++]=n}else if(n<65536){O[S++]=185;O[S++]=n>>8;O[S++]=n&255}else{O[S++]=186;mr.setUint32(S,n);S+=4}if(u.keyMap){for(let e=0;e{O[S++]=185;let e=S-s;S+=2;let n=0;if(u.keyMap){for(let e in t)if(r||t.hasOwnProperty(e)){p(u.encodeKey(e));p(t[e]);n++}}else{for(let e in t)if(r||t.hasOwnProperty(e)){p(e);p(t[e]);n++}}O[e+++s]=n>>8;O[e+s]=n&255}:(t,r)=>{let n,i=f.transitions||(f.transitions=Object.create(null));let u=0;let a=0;let o;let s;if(this.keyMap){s=Object.keys(t).map(e=>this.encodeKey(e));a=s.length;for(let t=0;t>8|224;O[S++]=c&255}else{if(!s)s=i.__keys__||(i.__keys__=Object.keys(t));if(o===undefined){c=f.nextId++;if(!c){c=0;f.nextId=1}if(c>=dr){f.nextId=(c=l)+1}}else{c=o}f[c]=s;if(c>8|224;O[S++]=c&255;i=f.transitions;for(let e=0;e=dr-l)h.shift()[Er]=undefined;h.push(i);kr(a+2);p(57344+c);p(s);if(r===null)return;for(let e in t)if(r||t.hasOwnProperty(e))p(t[e]);return}}if(a<24){O[S++]=128|a}else{kr(a)}if(r===null)return;for(let e in t)if(r||t.hasOwnProperty(e))p(t[e])};const w=e=>{let t;if(e>16777216){if(e-s>vr)throw new Error("Encoded buffer would be larger than maximum buffer size");t=Math.min(vr,Math.round(Math.max((e-s)*(e>67108864?1.25:2),4194304)/4096)*4096)}else t=(Math.max(e-s<<2,O.length-1)>>12)+1<<12;let r=new pr(t);mr=new DataView(r.buffer,0,t);if(O.copy)O.copy(r,0,s,e);else r.set(O.slice(s,e));S-=s;s=0;gr=r.length-10;return O=r};let D=100;let E=1e3;this.encodeAsIterable=function(e,t){return k(e,t,A)};this.encodeAsAsyncIterable=function(e,t){return k(e,t,C)};function*A(n,i,e){let t=n.constructor;if(t===Object){let r=u.useRecords!==false;if(r)b(n,null);else xr(Object.keys(n).length,160);for(let t in n){let e=n[t];if(!r)p(t);if(e&&typeof e==="object"){if(i[t])yield*A(e,i[t]);else yield*x(e,i,t)}else p(e)}}else if(t===Array){let e=n.length;kr(e);for(let t=0;tD)){if(i.element)yield*A(e,i.element);else yield*x(e,i,"element")}else p(e)}}else if(n[Symbol.iterator]){O[S++]=159;for(let e of n){if(e&&(typeof e==="object"||S-s>D)){if(i.element)yield*A(e,i.element);else yield*x(e,i,"element")}else p(e)}O[S++]=255}else if(Or(n)){xr(n.size,64);yield O.subarray(s,S);yield n;F()}else if(n[Symbol.asyncIterator]){O[S++]=159;yield O.subarray(s,S);yield n;F();O[S++]=255}else{p(n)}if(e&&S>s)yield O.subarray(s,S);else if(S-s>D){yield O.subarray(s,S);F()}}function*x(t,r,n){let i=S-s;try{p(t);if(S-s>D){yield O.subarray(s,S);F()}}catch(e){if(e.iteratorNotHandled){r[n]={};S=s+i;yield*A.call(this,t,r[n])}else throw e}}function F(){D=E;u.encode(null,Mr)}function k(e,t,r){if(t&&t.chunkThreshold)D=E=t.chunkThreshold;else D=100;if(e&&typeof e==="object"){u.encode(null,Mr);return r(e,u.iterateProperties||(u.iterateProperties={}),true)}return[u.encode(e)]}async function*C(e,t){for(let r of A(e,t,true)){let e=r.constructor;if(e===_r||e===Uint8Array)yield r;else if(Or(r)){let e=r.stream().getReader();let t;while(!(t=await e.read()).done){yield t.value}}else if(r[Symbol.asyncIterator]){for await(let e of r){F();if(e)yield*C(e,t.async||(t.async={}));else yield u.encode(e)}}else{yield r}}}}useBuffer(e){O=e;mr=new DataView(O.buffer,O.byteOffset,O.byteLength);S=0}clearSharedData(){if(this.structures)this.structures=[];if(this.sharedValues)this.sharedValues=undefined}updateSharedData(){let t=this.sharedVersion||0;this.sharedVersion=t+1;let e=this.structures.slice(0);let r=new Fr(e,this.sharedValues,this.sharedVersion);let n=this.saveShared(r,e=>(e&&e.version||0)==t);if(n===false){r=this.getShared()||{};this.structures=r.structures||[];this.sharedValues=r.packedValues;this.sharedVersion=r.version;this.structures.nextId=this.structures.length}else{e.forEach((e,t)=>this.structures[t]=e)}return n}}function xr(e,t){if(e<24)O[S++]=t|e;else if(e<256){O[S++]=t|24;O[S++]=e}else if(e<65536){O[S++]=t|25;O[S++]=e>>8;O[S++]=e&255}else{O[S++]=t|26;mr.setUint32(S,e);S+=4}}class Fr{constructor(e,t,r){this.structures=e;this.packedValues=t;this.version=r}}function kr(e){if(e<24)O[S++]=128|e;else if(e<256){O[S++]=152;O[S++]=e}else if(e<65536){O[S++]=153;O[S++]=e>>8;O[S++]=e&255}else{O[S++]=154;mr.setUint32(S,e);S+=4}}const Cr=typeof Blob==="undefined"?function(){}:Blob;function Or(e){if(e instanceof Cr)return true;let t=e[Symbol.toStringTag];return t==="Blob"||t==="File"}function Sr(r,n){switch(typeof r){case"string":if(r.length>3){if(n.objectMap[r]>-1||n.values.length>=n.maxValues)return;let e=n.get(r);if(e){if(++e.count==2){n.values.push(r)}}else{n.set(r,{count:1});if(n.samplingPackedValues){let e=n.samplingPackedValues.get(r);if(e)e.count++;else n.samplingPackedValues.set(r,{count:1})}}}break;case"object":if(r){if(r instanceof Array){for(let e=0,t=r.length;e=0&&r<4294967296){O[S++]=26;mr.setUint32(S,r);S+=4}else{O[S++]=251;mr.setFloat64(S,r);S+=8}}},{tag:258,encode(e,t){let r=Array.from(e);t(r)}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t(["RegExp",e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,r){Ir(e,r)}},{getTag(e){if(e.constructor===Uint8Array){if(this.tagUint8Array||hr&&this.tagUint8Array!==false)return 64}},encode(e,t,r){Ir(e,r)}},jr(68,1),jr(69,2),jr(70,4),jr(71,8),jr(72,1),jr(77,2),jr(78,4),jr(79,8),jr(85,4),jr(86,8),{encode(t,n){let e=t.packedValues||[];let r=t.structures||[];if(e.values.length>0){O[S++]=216;O[S++]=51;kr(4);let r=e.values;n(r);kr(0);kr(0);packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let e=0,t=r.length;e1)e-=4;return{tag:e,encode:function e(t,r){let n=t.byteLength;let i=t.byteOffset||0;let u=t.buffer||t;r(hr?lr.from(u,i,n):new Uint8Array(u,i,n))}}}function Ir(e,t){let r=e.byteLength;if(r<24){O[S++]=64+r}else if(r<256){O[S++]=88;O[S++]=r}else if(r<65536){O[S++]=89;O[S++]=r>>8;O[S++]=r&255}else{O[S++]=90;mr.setUint32(S,r);S+=4}if(S+r>=O.length){t(S+r)}O.set(e.buffer?e:new Uint8Array(e),S);S+=r}function Pr(n,e){let r;let i=e.length*2;let u=n.length-i;e.sort((e,t)=>e.offset>t.offset?1:-1);for(let r=0;r>8;n[e]=r&255}}while(r=e.pop()){let e=r.offset;n.copyWithin(e+i,e,u);i-=2;let t=e+i;n[t++]=216;n[t++]=28;u=e}return n}function Nr(e,t){mr.setUint32(br.position+e,S-br.position-e+1);let r=br;br=null;t(r[0]);t(r[1])}function Rr(e){if(e.Class){if(!e.encode)throw new Error("Extension has no encode function");fr.unshift(e.Class);cr.unshift(e)}ur(e)}let Tr=new Ar({useRecords:false});Tr.encode;Tr.encodeAsIterable;Tr.encodeAsAsyncIterable;const Lr=512;const Ur=1024;const Mr=2048;var qr={};
/**@license
*
* No Dependency fast and small LZJB Compression for Browser and Node
@@ -48,7 +48,7 @@
* Released under BSD-3-Clause License
*
* build: Wed, 27 Oct 2021 10:43:10 GMT
- */Object.defineProperty(nr,"__esModule",{value:true});const ir=8,ur=6,ar=3,or=(1<r-or){t[i++]=e[n++];continue}f=(e[n]+13^e[n+1]-13^e[n+2])&cr-1;c=n-l[f]&sr;l[f]=n;u=n-c;if(u>=0&&u!=n&&e[n]==e[u]&&e[n+1]==e[u+1]&&e[n+2]==e[u+2]){t[a]|=o;for(s=ar;s>ir;t[i++]=c;n+=s}else{t[i++]=e[n++]}}console.assert(e.length>=n);return i}function lr(e,t,r){t=t|0;var n=0,i=0,u=0,a=0,o=1<<(ir-1|0),s=0,c=0;while(n>(ir-ur|0))+ar|0;c=(e[n]<4){r[i]=r[u];i=i+1|0;u=u+1|0;r[i]=r[u];i=i+1|0;u=u+1|0;r[i]=r[u];i=i+1|0;u=u+1|0;r[i]=r[u];i=i+1|0;u=u+1|0;s=s-4|0}while(s>0){r[i]=r[u];i=i+1|0;u=u+1|0;s=s-1|0}}}else{r[i]=e[n];i=i+1|0;n=n+1|0}}return i}function hr(){const e=new TextEncoder("utf-8");return e.encode(pr)}const pr="@lzjb";const _r=hr();function dr(...e){if(e.length>1){const r=e.reduce((e,t)=>e+t.length,0);const n=new Uint8Array(r);let t=0;e.forEach(e=>{n.set(e,t);t+=e.length});return n}else if(e.length){return e[0]}}function vr(t){const e=Math.ceil(Math.log2(t)/8);const r=new Uint8Array(e);for(let e=0;e=0;e--){r=r*256+t[e]}return r}function yr(e,{magic:t=true}={}){const r=new Uint8Array(Math.max(e.length*1.5|0,16*1024));const n=fr(e,r);const i=vr(e.length);const u=[Uint8Array.of(i.length),i,r.slice(0,n)];if(t){u.unshift(_r)}return dr(...u)}function gr(t,{magic:e=true}={}){if(e){const e=new TextDecoder("utf-8");const s=e.decode(t.slice(0,_r.length));if(s!==pr){throw new Error("Invalid magic value")}}const r=e?_r.length:0;const n=t[r];const i=r+1;const u=r+n+1;const a=mr(t.slice(i,u));t=t.slice(u);const o=new Uint8Array(a);lr(t,t.length,o);return o}var br=nr.pack=yr;var wr=nr.unpack=gr;function Dr(s,c){return c=c||{},new Promise(function(e,t){var r=new XMLHttpRequest,n=[],i=[],u={},a=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:a,headers:{keys:function(){return n},entries:function(){return i},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};for(var o in r.open(c.method||"get",s,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,r){n.push(t=t.toLowerCase()),i.push([t,r]),u[t]=u[t]?u[t]+","+r:r}),e(a())},r.onerror=t,r.withCredentials="include"==c.credentials,c.headers)r.setRequestHeader(o,c.headers[o]);r.send(c.body||null)})}
+ */Object.defineProperty(qr,"__esModule",{value:true});const Yr=8,Vr=6,zr=3,$r=(1<r-$r){t[i++]=e[n++];continue}l=(e[n]+13^e[n+1]-13^e[n+2])&Kr-1;s=n-h[l]&Jr;h[l]=n;u=n-s;if(u>=0&&u!=n&&e[n]==e[u]&&e[n+1]==e[u+1]&&e[n+2]==e[u+2]){t[f]|=a;for(o=zr;o<$r;o++)if(e[n+o]!=e[u+o])break;t[i++]=o-zr<>Yr;t[i++]=s;n+=o}else{t[i++]=e[n++]}}console.assert(e.length>=n);return i}function Hr(e,t,r){t=t|0;var n=0,i=0,u=0,a=0,o=1<<(Yr-1|0),s=0,c=0;while(n>(Yr-Vr|0))+zr|0;c=(e[n]<4){r[i]=r[u];i=i+1|0;u=u+1|0;r[i]=r[u];i=i+1|0;u=u+1|0;r[i]=r[u];i=i+1|0;u=u+1|0;r[i]=r[u];i=i+1|0;u=u+1|0;s=s-4|0}while(s>0){r[i]=r[u];i=i+1|0;u=u+1|0;s=s-1|0}}}else{r[i]=e[n];i=i+1|0;n=n+1|0}}return i}function Wr(){const e=new TextEncoder("utf-8");return e.encode(Qr)}const Qr="@lzjb";const Zr=Wr();function Xr(...e){if(e.length>1){const r=e.reduce((e,t)=>e+t.length,0);const n=new Uint8Array(r);let t=0;e.forEach(e=>{n.set(e,t);t+=e.length});return n}else if(e.length){return e[0]}}function en(t){const e=Math.ceil(Math.log2(t)/8);const r=new Uint8Array(e);for(let e=0;e=0;e--){r=r*256+t[e]}return r}function rn(e,{magic:t=true}={}){const r=new Uint8Array(Math.max(e.length*1.5|0,16*1024));const n=Gr(e,r);const i=en(e.length);const u=[Uint8Array.of(i.length),i,r.slice(0,n)];if(t){u.unshift(Zr)}return Xr(...u)}function nn(t,{magic:e=true}={}){if(e){const e=new TextDecoder("utf-8");const s=e.decode(t.slice(0,Zr.length));if(s!==Qr){throw new Error("Invalid magic value")}}const r=e?Zr.length:0;const n=t[r];const i=r+1;const u=r+n+1;const a=tn(t.slice(i,u));t=t.slice(u);const o=new Uint8Array(a);Hr(t,t.length,o);return o}var un=qr.pack=rn;var an=qr.unpack=nn;function on(s,c){return c=c||{},new Promise(function(e,t){var r=new XMLHttpRequest,n=[],i=[],u={},a=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:a,headers:{keys:function(){return n},entries:function(){return i},get:function(e){return u[e.toLowerCase()]},has:function(e){return e.toLowerCase()in u}}}};for(var o in r.open(c.method||"get",s,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,r){n.push(t=t.toLowerCase()),i.push([t,r]),u[t]=u[t]?u[t]+","+r:r}),e(a())},r.onerror=t,r.withCredentials="include"==c.credentials,c.headers)r.setRequestHeader(o,c.headers[o]);r.send(c.body||null)})}
/**@license
* __ __ __
* / / \ \ _ _ ___ ___ \ \
@@ -59,12 +59,12 @@
*
*
*
- * LIPS is Pretty Simple - Scheme based Powerful LISP in JavaScript
+ * LIPS is Pretty Simple - Scheme based powerful LISP in JavaScript
*
* Copyright (c) 2018-2021 Jakub T. Jankiewicz
* Released under the MIT license
*
- * includes:
+ * Includes:
*
* ucs2decode function from Punycode v 2.1.1 by Mathias Bynens MIT License
*
@@ -83,5 +83,5 @@
* The rationalize algorithm is by Per M.A. Bothner, Alan Bawden and Marc Feeley.
* source: Kawa, C-Gambit
*
- * Build time: Mon, 15 Nov 2021 19:33:52 +0000
- */var Er=["token"],Ar=["stderr","stdin","stdout","command_line"];function Fr(i){var u=xr();return function e(){var t=s(i),r;if(u){var n=s(this).constructor;r=Reflect.construct(t,arguments,n)}else{r=t.apply(this,arguments)}return a(this,r)}}function xr(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(e){return false}}function Cr(t,e){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=kr(t))||e&&t&&typeof t.length==="number"){if(r)t=r;var n=0;var i=function e(){};return{s:i,n:function e(){if(n>=t.length)return{done:true};return{done:false,value:t[n++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,a=false,o;return{s:function e(){r=r.call(t)},n:function e(){var t=r.next();u=t.done;return t},e:function e(t){a=true;o=t},f:function e(){try{if(!u&&r["return"]!=null)r["return"]()}finally{if(a)throw o}}}}function kr(e,t){if(!e)return;if(typeof e==="string")return Or(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Or(e,t)}function Or(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments[1]===true;function t(e){if(!Mr()){return}var t=io.get("repr")(e);if(r===null||r instanceof RegExp&&r.test(t)){console.log(io.get("type")(e)+": "+t)}if(n){console.log(e)}}if(gu(e)){e.then(t)}else{t(e)}return e}function Mr(){return uo&&uo.get("DEBUG",{throwError:false})}function Yr(e){return e?"(?:#".concat(e,"(?:#[ie])?|#[ie]#").concat(e,")"):"(?:#[ie])?"}function $r(e,t){return"".concat(Yr(e),"[+-]?").concat(t,"+/").concat(t,"+")}function zr(e,t){return"".concat(Yr(e),"(?:[+-]?(?:").concat(t,"+/").concat(t,"+|nan.0|inf.0|").concat(t,"+))?(?:[+-]i|[+-]?(?:").concat(t,"+/").concat(t,"+|").concat(t,"+|nan.0|inf.0)i)(?=[()[\\]\\s]|$)")}function Vr(e,t){return"".concat(Yr(e),"[+-]?").concat(t,"+")}var Jr=/^#\/((?:\\\/|[^/]|\[[^\]]*\/[^\]]*\])+)\/([gimyus]*)$/;var Gr="(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\.[0-9]+|[0-9]+\\.[0-9]+)(?:[eE][-+]?[0-9]+)?)|[0-9]+\\.)";var Hr="(?:#[ie])?(?:[+-]?(?:[0-9]+/[0-9]+|nan.0|inf.0|".concat(Gr,"|[+-]?[0-9]+))?(?:").concat(Gr,"|[+-](?:[0-9]+/[0-9]+|[0-9]+|nan.0|inf.0))i");var Wr=new RegExp("^(#[ie])?".concat(Gr,"$"),"i");function Qr(e,t){var r=e==="x"?"(?!\\+|".concat(t,")"):"(?!\\.|".concat(t,")");var n="";if(e===""){n="(?:[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)|(?:\\.[0-9]+|[0-9]+\\.[0-9]+(?![0-9]))(?:[eE][-+]?[0-9]+)?))"}return new RegExp("^((?:(?:".concat(n,"|[-+]?inf.0|[-+]?nan.0|[+-]?").concat(t,"+/").concat(t,"+(?!").concat(t,")|[+-]?").concat(t,"+)").concat(r,")?)(").concat(n,"|[-+]?inf.0|[-+]?nan.0|[+-]?").concat(t,"+/").concat(t,"+|[+-]?").concat(t,"+|[+-])i$"),"i")}var Zr=function(){var u={};[[10,"","[0-9]"],[16,"x","[0-9a-fA-F]"],[8,"o","[0-7]"],[2,"b","[01]"]].forEach(function(e){var t=A(e,3),r=t[0],n=t[1],i=t[2];u[r]=Qr(n,i)});return u}();var Kr={alarm:"",backspace:"\b",delete:"",escape:"",newline:"\n",null:"\0",return:"\r",space:" ",tab:"\t",dle:"",soh:"",dc1:"",stx:"",dc2:"",etx:"",dc3:"",eot:"",dc4:"",enq:"",nak:"",ack:"",syn:"",bel:"",etb:"",bs:"\b",can:"",ht:"\t",em:"",lf:"\n",sub:"",vt:"\v",esc:"",ff:"\f",fs:"",cr:"\r",gs:"",so:"",rs:"",si:"",us:"",del:""};function Xr(e){var t=[];var r=0;var n=e.length;while(r=55296&&i<=56319&&r1&&arguments[1]!==undefined?arguments[1]:10;var r=_n(e);var n=r.number.split("/");var i=ka({num:da([n[0],r.radix||t]),denom:da([n[1],r.radix||t])});if(r.inexact){return i.valueOf()}else{return i}}function vn(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;var r=_n(e);if(r.inexact){return Ea(parseInt(r.number,r.radix||t))}return da([r.number,r.radix||t])}function mn(e){var t=e.match(/#\\x([0-9a-f]+)$/i);var r;if(t){var n=parseInt(t[1],16);r=String.fromCodePoint(n)}else{t=e.match(/#\\(.+)$/);if(t){r=t[1]}}if(r){return oa(r)}throw new Error("Parse: invalid character")}function yn(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;function t(e){var t;if(e==="+"){t=da(1)}else if(e==="-"){t=da(-1)}else if(e.match(cn)){t=da([e,i])}else if(e.match(fn)){var r=e.split("/");t=ka({num:da([r[0],i]),denom:da([r[1],i])})}else if(e.match(Wr)){var n=wn(e);if(u.exact){return n.toRational()}return n}else if(e.match(/nan.0$/)){return da(NaN)}else if(e.match(/inf.0$/)){if(e[0]==="-"){return da(Number.NEGATIVE_INFINITY)}return da(Number.POSITIVE_INFINITY)}else{throw new Error("Internal Parser Error")}if(u.inexact){return Ea(t.valueOf())}return t}var u=_n(e);i=u.radix||i;var r;var n=u.number.match(hn);if(i!==10&&n){r=n}else{r=u.number.match(Zr[i])}var a,o;o=t(r[2]);if(r[1]){a=t(r[1])}else{a=da(0)}if(o.cmp(0)===0&&o.__type__==="bigint"){return a}return Da({im:o,re:a})}function gn(e){return parseInt(e.toString(),10)===e}function bn(e){var t=e.match(/^(([-+]?[0-9]*)(?:\.([0-9]+))?)e([-+]?[0-9]+)/i);if(t){var r=parseInt(t[4],10);var n;var i=t[1].replace(/[-+]?([0-9]*)\..+$/,"$1").length;var u=t[3]&&t[3].length;if(i0){return da(u).mul(o)}}}r=Ea(r);if(t.exact){return r.toRational()}return r}function Dn(e){e=e.replace(/\\x([0-9a-f]+);/gi,function(e,t){return"\\u"+t.padStart(4,"0")}).replace(/\n/g,"\\n");var t=e.match(/(\\*)(\\x[0-9A-F])/i);if(t&&t[1].length%2===0){throw new Error("Invalid string literal, unclosed ".concat(t[2]))}try{return sa(JSON.parse(e))}catch(e){throw new Error("Invalid string literal")}}function En(e){if(e.match(/^\|.*\|$/)){e=e.replace(/(^\|)|(\|$)/g,"");var r={t:"\t",r:"\r",n:"\n"};e=e.replace(/\\(x[^;]+);/g,function(e,t){return String.fromCharCode(parseInt("0"+t,16))}).replace(/\\(.)/g,function(e,t){return r[t]||t})}return new Ln(e)}function An(e){if(no.hasOwnProperty(e)){return no[e]}if(e.match(/^"[\s\S]*"$/)){return Dn(e)}else if(e[0]==="#"){var t=e.match(Jr);if(t){return new RegExp(t[1],t[2])}else if(e.match(rn)){return mn(e)}var r=e.match(/#\\(.+)/);if(r&&Xr(r[1]).length===1){return mn(e)}}if(e.match(/[0-9a-f]|[+-]i/i)){if(e.match(sn)){return vn(e)}else if(e.match(Wr)){return wn(e)}else if(e.match(on)){return dn(e)}else if(e.match(an)){return yn(e)}}if(e.match(/^#[iexobd]/)){throw new Error("Invalid numeric constant: "+e)}return En(e)}function Fn(e){return!(["(",")","[","]"].includes(e)||Jn.names().includes(e))}function xn(e){return Fn(e)&&!(e.match(Jr)||e.match(/^"[\s\S]*"$/)||e.match(sn)||e.match(Wr)||e.match(an)||e.match(on)||e.match(rn)||["#t","#f","nil","true","false"].includes(e))}var Cn=/"(?:\\[\S\s]|[^"])*"?/g;function kn(e){if(typeof e==="string"){var t=/([-\\^$[\]()+{}?*.|])/g;return e.replace(t,"\\$1")}return e}function On(){this.data=[]}On.prototype.push=function(e){this.data.push(e)};On.prototype.top=function(){return this.data[this.data.length-1]};On.prototype.pop=function(){return this.data.pop()};On.prototype.is_empty=function(){return!this.data.length};function Sn(e){if(e instanceof sa){e=e.valueOf()}var t=new Zn(e,{whitespace:true});var r=[];while(true){var n=t.peek(true);if(n===$a){break}r.push(n);t.skip()}return r}function Bn(e){var t=e.token,r=D(e,Er);if(t.match(/^"[\s\S]*"$/)&&t.match(/\n/)){var n=new RegExp("^ {1,"+(e.col+1)+"}","mg");t=t.replace(n,"")}return Br({token:t},r)}function jn(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};this.fn=e;this.cont=t}jn.prototype.toString=function(){return"#"};function In(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r1&&arguments[1]!==undefined?arguments[1]:false;if(e instanceof sa){e=e.toString()}if(t){return Sn(e)}else{var r=Sn(e).map(function(e){if(e.token==="#\\ "){return e.token}return e.token.trim()}).filter(function(e){return e&&!e.match(/^;/)&&!e.match(/^#\|[\s\S]*\|#$/)});return Rn(r)}}function Rn(e){var t=0;var r=null;var n=[];for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:null;if(e instanceof Ln){if(e.is_gensym()){return e}e=e.valueOf()}if(qn(e)){return Ln(e)}if(e!==null){return r(e,Symbol("#:".concat(e)))}t++;return r(t,Symbol("#:g".concat(t)))}}();function Yn(e){var r=this;var n={pending:true,rejected:false,fulfilled:false,reason:undefined,type:undefined};e=e.then(function(e){n.type=Ao(e);n.fulfilled=true;n.pending=false;return e});ai(this,"_promise",e,{hidden:true});if(vu(e["catch"])){e=e["catch"](function(e){n.rejected=true;n.pending=false;n.reason=e})}Object.keys(n).forEach(function(t){Object.defineProperty(r,"__".concat(t,"__"),{enumerable:true,get:function e(){return n[t]}})});ai(this,"__promise__",e);this.then=false}Yn.prototype.then=function(e){return new Yn(this.valueOf().then(e))};Yn.prototype["catch"]=function(e){return new Yn(this.valueOf()["catch"](e))};Yn.prototype.valueOf=function(){if(!this._promise){throw new Error("QuotedPromise: invalid promise created")}return this._promise};Yn.prototype.toString=function(){if(this.__pending__){return Yn.pending_str}if(this.__rejected__){return Yn.rejected_str}return"#")};Yn.pending_str="#";Yn.rejected_str="#";function $n(e){if(Array.isArray(e)){return Promise.all(zn(e)).then(Vn)}return e}function zn(e){var t=new Array(e.length),r=e.length;while(r--){var n=e[r];if(n instanceof Yn){t[r]=new Ha(n)}else{t[r]=n}}return t}function Vn(e){var t=new Array(e.length),r=e.length;while(r--){var n=e[r];if(n instanceof Ha){t[r]=n.valueOf()}else{t[r]=n}}return t}var Jn={LITERAL:Symbol["for"]("literal"),SPLICE:Symbol["for"]("splice"),SYMBOL:Symbol["for"]("symbol"),names:function e(){return Object.keys(this._specials)},type:function e(t){return this.get(t).type},get:function e(t){return this._specials[t]},off:function e(t){var r=this;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(Array.isArray(t)){t.forEach(function(e){return r.off(e,n)})}else if(n===null){delete this._events[t]}else{this._events=this._events.filter(function(e){return e!==n})}},on:function e(t,r){var n=this;if(Array.isArray(t)){t.forEach(function(e){return n.on(e,r)})}else if(!this._events[t]){this._events[t]=[r]}else{this._events[t].push(r)}},trigger:function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i",new Ln("quote-promise"),Jn.LITERAL]];Object.defineProperty(Jn,"builtin",{writable:false,value:Qn.map(function(e){return e[0]})});Qn.forEach(function(e){var t=A(e,3),r=t[0],n=t[1],i=t[2];Jn.append(r,n,i)});var Zn=function(){function p(e){var t=this;var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.whitespace,i=n===void 0?false:n;y(this,p);ai(this,"__input__",e.replace(/\r/g,""));var u={};["_i","_whitespace","_col","_newline","_line","_state","_next","_token","_prev_char"].forEach(function(r){Object.defineProperty(t,r,{configurable:false,enumerable:false,get:function e(){return u[r]},set:function e(t){u[r]=t}})});this._whitespace=i;this._i=this._line=this._col=this._newline=0;this._state=this._next=this._token=null;this._prev_char=""}b(p,[{key:"get",value:function e(t){return this.__internal[t]}},{key:"set",value:function e(t,r){this.__internal[t]=r}},{key:"token",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(t){var r=this._line;if(this._whitespace&&this._token==="\n"){--r}return{token:this._token,col:this._col,offset:this._i,line:r}}return this._token}},{key:"peek",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(this._i>=this.__input__.length){return $a}if(this._token){return this.token(t)}var r=this.next_token();if(r){this._token=this.__input__.substring(this._i,this._next);return this.token(t)}return $a}},{key:"skip",value:function e(){if(this._next!==null){this._token=null;this._i=this._next}}},{key:"read_line",value:function e(){var t=this.__input__.length;if(this._i>=t){return $a}for(var r=this._i;r=r){return $a}if(t+this._i>=r){return this.read_rest()}var n=this._i+t;var i=this.__input__.substring(this._i,n);var u=i.match(/\n/g);if(u){this._line+=u.length}this._i=n;return i}},{key:"peek_char",value:function e(){if(this._i>=this.__input__.length){return $a}return oa(this.__input__[this._i])}},{key:"read_char",value:function e(){var t=this.peek_char();this.skip_char();return t}},{key:"skip_char",value:function e(){if(this._i1&&arguments[1]!==undefined?arguments[1]:{},n=r.prev_char,i=r["char"],u=r.next_char;var a=A(t,4),o=a[0],s=a[1],c=a[2],f=a[3];if(t.length!==5){throw new Error("Lexer: Invald rule of length ".concat(t.length))}if(!i.match(o)){return false}if(!Kn(s,n)){return false}if(!Kn(c,u)){return false}if(f!==this._state){return false}return true}},{key:"next_token",value:function e(){if(this._i>=this.__input__.length){return false}var t=true;e:for(var r=this._i,n=this.__input__.length;r2&&arguments[2]!==undefined?arguments[2]:null;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;if(t.length===0){throw new Error("Lexer: invalid literal rule")}if(t.length===1){return[[t,n,i,null,null]]}var u=[];for(var a=0,o=t.length;a1&&arguments[1]!==undefined?arguments[1]:{},r=t.env,n=t.meta,i=n===void 0?false:n,u=t.formatter,a=u===void 0?Bn:u;y(this,o);if(e instanceof sa){e=e.toString()}ai(this,"_formatter",a,{hidden:true});ai(this,"__lexer__",new Zn(e));ai(this,"__env__",r);ai(this,"_meta",i,{hidden:true});ai(this,"_refs",[],{hidden:true});ai(this,"_state",{parentheses:0},{hidden:true})}b(o,[{key:"resolve",value:function e(t){return this.__env__&&this.__env__.get(t,{throwError:false})}},{key:"peek",value:function(){var e=O(j.mark(function e(){var r;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:r=this.__lexer__.peek(true);if(!(r===$a)){t.next=4;break}return t.abrupt("return",$a);case 4:if(!this.is_comment(r.token)){t.next=7;break}this.skip();return t.abrupt("continue",0);case 7:if(!(r.token==="#;")){t.next=14;break}this.skip();if(!(this.__lexer__.peek()===$a)){t.next=11;break}throw new Error("Lexer: syntax error eof found after comment");case 11:t.next=13;return this._read_object();case 13:return t.abrupt("continue",0);case 14:return t.abrupt("break",17);case 17:r=this._formatter(r);if(!this._meta){t.next=20;break}return t.abrupt("return",r);case 20:return t.abrupt("return",r.token);case 21:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"reset",value:function e(){this._refs.length=0}},{key:"skip",value:function e(){this.__lexer__.skip()}},{key:"read",value:function(){var e=O(j.mark(function e(){var r;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.next=2;return this.peek();case 2:r=t.sent;this.skip();return t.abrupt("return",r);case 5:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"match_datum_label",value:function e(t){var r=t.match(/^#([0-9]+)=$/);return r&&r[1]}},{key:"match_datum_ref",value:function e(t){var r=t.match(/^#([0-9]+)#$/);return r&&r[1]}},{key:"is_open",value:function e(t){var r=["(","["].includes(t);if(r){this._state.parentheses++}return r}},{key:"is_close",value:function e(t){var r=[")","]"].includes(t);if(r){this._state.parentheses--}return r}},{key:"read_list",value:function(){var e=O(j.mark(function e(){var r,n,i,u;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:r=Pi,n=r;case 1:t.next=4;return this.peek();case 4:i=t.sent;if(!(i===$a)){t.next=7;break}return t.abrupt("break",27);case 7:if(!this.is_close(i)){t.next=10;break}this.skip();return t.abrupt("break",27);case 10:if(!(i==="."&&r!==Pi)){t.next=17;break}this.skip();t.next=14;return this._read_object();case 14:n.cdr=t.sent;t.next=25;break;case 17:t.t0=Ni;t.next=20;return this._read_object();case 20:t.t1=t.sent;t.t2=Pi;u=new t.t0(t.t1,t.t2);if(r===Pi){r=u}else{n.cdr=u}n=u;case 25:t.next=1;break;case 27:return t.abrupt("return",r);case 28:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"read_value",value:function(){var e=O(j.mark(function e(){var r;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.next=2;return this.read();case 2:r=t.sent;if(!(r===$a)){t.next=5;break}throw new Error("Parser: Expected token eof found");case 5:return t.abrupt("return",An(r));case 6:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"is_comment",value:function e(t){return t.match(/^;/)||t.match(/^#\|/)&&t.match(/\|#$/)}},{key:"evaluate",value:function e(t){return Io(t,{env:this.__env__,error:function e(t){throw t}})}},{key:"read_object",value:function(){var e=O(j.mark(function e(){var r;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:this.reset();t.next=3;return this._read_object();case 3:r=t.sent;if(r instanceof ei){r=r.valueOf()}if(!this._refs.length){t.next=7;break}return t.abrupt("return",this._resolve_object(r));case 7:return t.abrupt("return",r);case 8:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()},{key:"ballanced",value:function e(){return this._state.parentheses===0}},{key:"ballancing_error",value:function e(t){var r=this._state.parentheses;var n=new Error("Parser: expected parenthesis but eof found");var i=new RegExp("\\){".concat(r,"}$"));n.__code__=[t.toString().replace(i,"")];throw n}},{key:"_resolve_object",value:function(){var t=O(j.mark(function e(r){var n=this;var i;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!Array.isArray(r)){t.next=2;break}return t.abrupt("return",r.map(function(e){return n._resolve_object(e)}));case 2:if(!Li(r)){t.next=6;break}i={};Object.keys(r).forEach(function(e){i[e]=n._resolve_object(r[e])});return t.abrupt("return",i);case 6:if(!(r instanceof Ni)){t.next=8;break}return t.abrupt("return",this._resolve_pair(r));case 8:return t.abrupt("return",r);case 9:case"end":return t.stop()}}},e,this)}));function e(e){return t.apply(this,arguments)}return e}()},{key:"_resolve_pair",value:function(){var t=O(j.mark(function e(r){return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!(r instanceof Ni)){t.next=15;break}if(!(r.car instanceof ei)){t.next=7;break}t.next=4;return r.car.valueOf();case 4:r.car=t.sent;t.next=8;break;case 7:this._resolve_pair(r.car);case 8:if(!(r.cdr instanceof ei)){t.next=14;break}t.next=11;return r.cdr.valueOf();case 11:r.cdr=t.sent;t.next=15;break;case 14:this._resolve_pair(r.cdr);case 15:return t.abrupt("return",r);case 16:case"end":return t.stop()}}},e,this)}));function e(e){return t.apply(this,arguments)}return e}()},{key:"_read_object",value:function(){var e=O(j.mark(function e(){var r,n,i,u,a,o,s,c,f;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:t.next=2;return this.peek();case 2:r=t.sent;if(!(r===$a)){t.next=5;break}return t.abrupt("return",r);case 5:if(!Gn(r)){t.next=35;break}n=Jn.get(r);i=Hn(r);this.skip();t.next=11;return this._read_object();case 11:a=t.sent;if(i){t.next=22;break}o=this.__env__.get(n.symbol);if(!(typeof o==="function")){t.next=22;break}if(!Wn(r)){t.next=19;break}return t.abrupt("return",o.call(this.__env__,a));case 19:if(!(a instanceof Ni)){t.next=21;break}return t.abrupt("return",o.apply(this.__env__,a.to_array(false)));case 21:throw new Error("Parse Error: Invalid parser extension "+"invocation ".concat(n.symbol));case 22:if(Wn(r)){u=new Ni(n.symbol,new Ni(a,Pi))}else{u=new Ni(n.symbol,a)}if(!i){t.next=25;break}return t.abrupt("return",u);case 25:if(!(o instanceof au)){t.next=34;break}t.next=28;return this.evaluate(u);case 28:s=t.sent;if(!(s instanceof Ni||s instanceof Ln)){t.next=31;break}return t.abrupt("return",Ni.fromArray([Ln("quote"),s]));case 31:return t.abrupt("return",s);case 34:throw new Error("Parse Error: invlid parser extension: "+n.symbol);case 35:c=this.match_datum_ref(r);if(!(c!==null)){t.next=41;break}this.skip();if(!this._refs[c]){t.next=40;break}return t.abrupt("return",new ei(c,this._refs[c]));case 40:throw new Error("Parse Error: invalid datum label #".concat(c,"#"));case 41:f=this.match_datum_label(r);if(!(f!==null)){t.next=48;break}this.skip();this._refs[f]=this._read_object();return t.abrupt("return",this._refs[f]);case 48:if(!this.is_open(r)){t.next=53;break}this.skip();return t.abrupt("return",this.read_list());case 53:return t.abrupt("return",this.read_value());case 54:case"end":return t.stop()}}},e,this)}));function t(){return e.apply(this,arguments)}return t}()}]);return o}();var ei=function(){function r(e,t){y(this,r);this.name=e;this.data=t}b(r,[{key:"valueOf",value:function e(){return this.data}}]);return r}();function ti(e,t){return ri.apply(this,arguments)}function ri(){ri=e(j.mark(function e(r,n){var i,u;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!n){if(io){n=io.get("**interaction-environment**",{throwError:false})}else{n=uo}}i=new Xn(r,{env:n});case 2:t.next=5;return C(i.read_object());case 5:u=t.sent;if(!i.ballanced()){i.ballancing_error(u)}if(!(u===$a)){t.next=9;break}return t.abrupt("break",13);case 9:t.next=11;return u;case 11:t.next=2;break;case 13:case"end":return t.stop()}}},e)}));return ri.apply(this,arguments)}function ni(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(e){return e};var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(gu(e)){var n=e.then(t);if(r===null){return n}else{return n["catch"](r)}}if(e instanceof Array){return ii(e,t,r)}if(Li(e)){return ui(e,t,r)}return t(e)}function ii(t,r,e){if(t.find(gu)){return ni($n(t),function(e){if(Object.isFrozen(t)){Object.freeze(e)}return r(e)},e)}return r(t)}function ui(t,e,r){var i=Object.keys(t);var n=[],u=[];var a=i.length;while(a--){var o=i[a];var s=t[o];n[a]=s;if(gu(s)){u.push(s)}}if(u.length){return ni($n(n),function(e){var n={};e.forEach(function(e,t){var r=i[t];n[r]=e});if(Object.isFrozen(t)){Object.freeze(n)}return n},r)}return e(t)}function ai(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},i=n.hidden,u=i===void 0?false:i;Object.defineProperty(e,t,{value:r,configurable:true,enumerable:!u})}function oi(r){var n,i,u,a,o,s,c;return j.async(function e(t){while(1){switch(t.prev=t.next){case 0:n=[];i=false;u=false;t.prev=3;o=F(r);case 5:t.next=7;return j.awrap(o.next());case 7:if(!(i=!(s=t.sent).done)){t.next=13;break}c=s.value;n.push(c);case 10:i=false;t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15;t.t0=t["catch"](3);u=true;a=t.t0;case 19:t.prev=19;t.prev=20;if(!(i&&o["return"]!=null)){t.next=24;break}t.next=24;return j.awrap(o["return"]());case 24:t.prev=24;if(!u){t.next=27;break}throw a;case 27:return t.finish(24);case 28:return t.finish(19);case 29:return t.abrupt("return",n);case 30:case"end":return t.stop()}}},null,null,[[3,15,19,29],[20,,24,28]],Promise)}function si(e,t){if(t instanceof RegExp){return function(e){return String(e).match(t)}}else if(vu(t)){return t}throw new Error("Invalid matcher")}function ci(e,t,r,n){if(typeof e!=="string"){t=arguments[0];r=arguments[1];n=arguments[2];e=null}if(r){if(n){t.__doc__=r}else{t.__doc__=fi(r)}}if(e){t.__name__=e}else if(t.name&&!Vu(t)){t.__name__=t.name}return t}function fi(e){return e.split("\n").map(function(e){return e.trim()}).join("\n")}function li(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var r=e.length;if(t<=0){throw Error("previousSexp: Invalid argument sexp = ".concat(t))}e:while(t--&&r>=0){var n=1;while(n>0){var i=e[--r];if(!i){break e}if(i==="("||i.token==="("){n--}else if(i===")"||i.token===")"){n++}}r--}return e.slice(r+1)}function hi(e){if(!e||!e.length){return 0}var t=e.length;if(e[t-1].token==="\n"){return 0}while(--t){if(e[t].token==="\n"){var r=(e[t+1]||{}).token;if(r){return r.length}}}return 0}function pi(e,t){return f(e,t)===t.length;function f(r,n){function e(e,t){var r=Cr(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;var u=f(i,t);if(u!==-1){return u}}}catch(e){r.e(e)}finally{r.f()}return-1}function t(){return r[u]===Symbol["for"]("symbol")&&!xn(n[o])}function i(){var e=r[u+1];var t=n[o+1];if(e!==undefined&&t!==undefined){return f([e],[t])}}var u=0;var a={};for(var o=0;o0){continue}}else if(t()){return-1}}else if(r[u]instanceof Array){var c=f(r[u],n.slice(o));if(c===-1||c+o>n.length){return-1}o+=c-1;u++;continue}else{return-1}u++}if(r.length!==u){return-1}return n.length}}function _i(e){this.__code__=e.replace(/\r/g,"")}_i.defaults={offset:0,indent:2,exceptions:{specials:[/^(?:#:)?(?:define(?:-values|-syntax|-macro|-class|-record-type)?|(?:call-with-(?:input-file|output-file|port))|lambda|let-env|try|catch|when|unless|while|syntax-rules|(let|letrec)(-syntax|\*)?)$/],shift:{1:["&","#"]}}};_i.match=pi;_i.prototype._options=function e(t){var r=_i.defaults;if(typeof t==="undefined"){return Object.assign({},r)}var n=t&&t.exceptions||{};var i=n.specials||[];var u=n.shift||{1:[]};return Br(Br(Br({},r),t),{},{exceptions:{specials:[].concat(k(r.exceptions.specials),k(i)),shift:Br(Br({},u),{},{1:[].concat(k(r.exceptions.shift[1]),k(u[1]))})}})};_i.prototype.indent=function e(t){var r=Nn(this.__code__,true);return this._indent(r,t)};_i.exception_shift=function(u,e){function t(e){if(!e.length){return false}if(e.indexOf(u)!==-1){return true}else{var t=e.filter(function(e){return e instanceof RegExp});if(!t.length){return false}var r=Cr(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(u.match(i)){return true}}}catch(e){r.e(e)}finally{r.f()}}return false}if(t(e.exceptions.specials)){return e.indent}var r=e.exceptions.shift;for(var n=0,i=Object.entries(r);n0){n.offset=0}if(u.toString()===t.toString()&&To(u)){return n.offset+u[0].col}else if(u.length===1){return n.offset+u[0].col+1}else{var s=-1;if(a){var c=_i.exception_shift(a.token,n);if(c!==-1){s=c}}if(s===-1){s=_i.exception_shift(u[1].token,n)}if(s!==-1){return n.offset+u[0].col+s}else if(u[0].line3&&u[1].line===u[3].line){if(u[1].token==="("||u[1].token==="["){return n.offset+u[1].col}return n.offset+u[3].col}else if(u[0].line===u[1].line){return n.offset+n.indent+u[0].col}else{var f=u.slice(2);for(var l=0;l")};di.prototype.match=function(e){return e.match(this.pattern)};function vi(){for(var e=arguments.length,t=new Array(e),r=0;r")};_i.Pattern=vi;_i.Ahead=di;var mi=/^[[(]$/;var yi=/^[\])]$/;var gi=/[^()[\]]/;var bi=new di(/[^)\]]/);var wi=Symbol["for"]("*");var Di=new vi([mi,wi,yi],[gi],"+");var Ei=new vi([mi,wi,yi],"+");var Ai=new vi([Symbol["for"]("symbol")],"?");var Fi=new vi([Symbol["for"]("symbol")],"*");var xi=[mi,Fi,yi];var Ci=new vi([mi,Symbol["for"]("symbol"),wi,yi],"+");var ki=Bi("define","lambda","define-macro","syntax-rules");var Oi=/^(?!.*\b(?:[()[\]]|define(?:-macro)?|let(?:\*|rec|-env|-syntax|)?|lambda|syntax-rules)\b).*$/;var Si=/^(?:#:)?(let(?:\*|rec|-env|-syntax)?)$/;function Bi(){for(var e=arguments.length,t=new Array(e),r=0;r0&&!o[e]){o[e]=li(a,e)}});var s=Cr(i),c;try{for(s.s();!(c=s.n()).done;){var f=A(c.value,3),l=f[0],h=f[1],p=f[2];h=h.valueOf();var _=h>0?o[h]:a;var d=_.filter(function(e){return e.trim()&&!Gn(e)});var v=r(_);var m=pi(l,d);var y=n.slice(u).find(function(e){return e.trim()&&!Gn(e)});if(m&&(p instanceof di&&p.match(y)||!p)){var g=u-v;if(n[g]!=="\n"){if(!n[g].trim()){n[g]="\n"}else{n.splice(g,0,"\n");u++}}u+=v;continue e}}}catch(e){s.e(e)}finally{s.f()}}this.__code__=n.join("");return this};_i.prototype._spaces=function(e){return new Array(e+1).join(" ")};_i.prototype.format=function e(t){var r=this.__code__.replace(/[ \t]*\n[ \t]*/g,"\n ");var n=Nn(r,true);var i=this._options(t);var u=0;var a=0;for(var o=0;o0&&arguments[0]!==undefined?arguments[0]:true;var n=new Map;function i(e){if(e instanceof Ni){if(n.has(e)){return n.get(e)}var t=new Ni;n.set(e,t);if(r){t.car=i(e.car)}else{t.car=e.car}t.cdr=i(e.cdr);t[Ru]=e[Ru];return t}return e}return i(this)};Ni.prototype.last_pair=function(){var e=this;while(true){if(e.cdr===Pi){return e}e=e.cdr}};Ni.prototype.to_array=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var t=[];if(this.car instanceof Ni){if(e){t.push(this.car.to_array())}else{t.push(this.car)}}else{t.push(this.car.valueOf())}if(this.cdr instanceof Ni){t=t.concat(this.cdr.to_array())}return t};Ni.fromArray=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(e instanceof Ni||r&&e instanceof Array&&e[Pu]){return e}if(t===false){var n=Pi;for(var i=e.length;i--;){n=new Ni(e[i],n)}return n}if(e.length&&!(e instanceof Array)){e=k(e)}var u=Pi;var a=e.length;while(a--){var o=e[a];if(o instanceof Array){o=Ni.fromArray(o,t,r)}else if(typeof o==="string"){o=sa(o)}else if(typeof o==="number"&&!Number.isNaN(o)){o=da(o)}u=new Ni(o,u)}return u};Ni.prototype.to_object=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this;var r={};while(true){if(t instanceof Ni&&t.car instanceof Ni){var n=t.car;var i=n.car;if(i instanceof Ln){i=i.__name__}if(i instanceof sa){i=i.valueOf()}var u=n.cdr;if(u instanceof Ni){u=u.to_object(e)}if(bo(u)){if(!e){u=u.valueOf()}}r[i]=u;t=t.cdr}else{break}}return r};Ni.fromPairs=function(e){return e.reduce(function(e,t){return new Ni(new Ni(new Ln(t[0]),t[1]),e)},Pi)};Ni.fromObject=function(t){var e=Object.keys(t).map(function(e){return[e,t[e]]});return Ni.fromPairs(e)};Ni.prototype.reduce=function(e){var t=this;var r=Pi;while(true){if(t!==Pi){r=e(r,t.car);t=t.cdr}else{break}}return r};Ni.prototype.reverse=function(){if(this.haveCycles()){throw new Error("You can't reverse list that have cycles")}var e=this;var t=Pi;while(e!==Pi){var r=e.cdr;e.cdr=t;t=e;e=r}return t};Ni.prototype.transform=function(n){function i(e){if(e instanceof Ni){if(e.replace){delete e.replace;return e}var t=n(e.car);if(t instanceof Ni){t=i(t)}var r=n(e.cdr);if(r instanceof Ni){r=i(r)}return new Ni(t,r)}return e}return i(this)};Ni.prototype.map=function(e){if(typeof this.car!=="undefined"){return new Ni(e(this.car),this.cdr===Pi?Pi:this.cdr.map(e))}else{return Pi}};var Ti=new Map;function Li(e){return e&&_(e)==="object"&&e.constructor===Object}var Ui=Object.getOwnPropertyNames(Array.prototype);var qi=[];Ui.forEach(function(e){qi.push(Array[e],Array.prototype[e])});function Mi(e){e=Fu(e);return qi.includes(e)}function Yi(e){return vu(e)&&(Vu(e)||e.__doc__)}function $i(r){var e=r.constructor||Object;var n=Li(r);var i=vu(r[Symbol.asyncIterator])||vu(r[Symbol.iterator]);var u;if(Ti.has(e)){u=Ti.get(e)}else{Ti.forEach(function(e,t){t=Fu(t);if(r.constructor===t&&(t===Object&&n&&!i||t!==Object)){u=e}})}return u}var zi=new Map;[[true,"#t"],[false,"#f"],[null,"null"],[undefined,"#"]].forEach(function(e){var t=A(e,2),r=t[0],n=t[1];zi.set(r,n)});function Vi(r){if(r&&_(r)==="object"){var n={};var e=Object.getOwnPropertySymbols(r);e.forEach(function(e){var t=e.toString().replace(/Symbol\(([^)]+)\)/,"$1");n[t]=Zi(r[e])});var t=Object.getOwnPropertyNames(r);t.forEach(function(e){var t=r[e];if(t&&_(t)==="object"&&t.constructor===Object){n[e]=Vi(t)}else{n[e]=Zi(t)}});return n}return r}function Ji(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function Gi(e,t){return e.hasOwnProperty(t)&&vu(e.toString)}function Hi(e){if(Hu(e)){return"#"}var t=e.prototype&&e.prototype.constructor;if(vu(t)&&Vu(t)){if(e[Tu]&&t.hasOwnProperty("__name__")){var r=t.__name__;if(sa.isString(r)){r=r.toString();return"#")}return"#"}}if(e.hasOwnProperty("__name__")){var n=e.__name__;if(_(n)==="symbol"){n=Un(n)}if(typeof n==="string"){return"#")}}if(Gi(e,"toString")){return e.toString()}else if(e.name&&!Vu(e)){return"#")}else{return"#"}}var Wi=new Map;[[Error,function(e){return e.message}],[Ni,function(e,t){var r=t.quote,n=t.skip_cycles,i=t.pair_args;if(!n){e.markCycles()}return e.toString.apply(e,[r].concat(k(i)))}],[oa,function(e,t){var r=t.quote;if(r){return e.toString()}return e.valueOf()}],[sa,function(e,t){var r=t.quote;e=e.toString();if(r){return JSON.stringify(e).replace(/\\n/g,"\n")}return e}],[RegExp,function(e){return"#"+e.toString()}]].forEach(function(e){var t=A(e,2),r=t[0],n=t[1];Wi.set(r,n)});var Qi=[Ln,da,au,Wa,Sa,Ba,Ga,Yn];function Zi(e,t,r){if(typeof jQuery!=="undefined"&&e instanceof jQuery.fn.init){return"#"}if(zi.has(e)){return zi.get(e)}if(Ki(e)){return"#"}if(e){var n=e.constructor;if(Wi.has(n)){for(var i=arguments.length,u=new Array(i>3?i-3:0),a=3;a"}if(e===null){return"null"}if(_(e)==="object"){var f=e.constructor;if(!f){f=Object}var l;if(typeof f.__class__==="string"){l=f.__class__}else{var h=$i(e);if(h){if(vu(h)){return h(e,t)}else{throw new Error("toString: Invalid repr value")}}l=f.name}if(vu(e.toString)&&Vu(e.toString)){return e.toString().valueOf()}if(Ao(e)==="instance"){if(Vu(f)&&f.__name__){l=f.__name__.valueOf()}else if(!Hu(f)){l="instance"}}if(Do(e,Symbol.iterator)){if(l){return"#")}return"#"}if(Do(e,Symbol.asyncIterator)){if(l){return"#")}return"#"}if(l!==""){return"#<"+l+">"}return"#"}if(typeof e!=="string"){return e.toString()}return e}function Ki(e){return e&&_(e)==="object"&&e.hasOwnProperty&&e.hasOwnProperty("constructor")&&typeof e.constructor==="function"&&e.constructor.prototype===e}Ni.prototype.markCycles=function(){Xi(this);return this};Ni.prototype.haveCycles=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;if(!e){return this.haveCycles("car")||this.haveCycles("cdr")}return!!(this[Ru]&&this[Ru][e])};function Xi(e){var t=[];var i=[];var u=[];function a(e){if(!t.includes(e)){t.push(e)}}function o(e,t,r,n){if(r instanceof Ni){if(n.includes(r)){if(!u.includes(r)){u.push(r)}if(!e[Ru]){e[Ru]={}}e[Ru][t]=r;if(!i.includes(e)){i.push(e)}return true}}}var s=In(function e(t,r){if(t instanceof Ni){delete t.ref;delete t[Ru];a(t);r.push(t);var n=o(t,"car",t.car,r);var i=o(t,"cdr",t.cdr,r);if(!n){s(t.car,r.slice())}if(!i){return new jn(function(){return e(t.cdr,r.slice())})}}});function r(e,t){if(e[Ru][t]instanceof Ni){var r=n.indexOf(e[Ru][t]);e[Ru][t]="#".concat(r,"#")}}s(e,[]);var n=t.filter(function(e){return u.includes(e)});n.forEach(function(e,t){e[Nu]="#".concat(t,"=")});i.forEach(function(e){r(e,"car");r(e,"cdr")})}Ni.prototype.toString=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},r=t.nested,n=r===void 0?false:r;var i=[];if(this[Nu]){i.push(this[Nu]+"(")}else if(!n){i.push("(")}var u;if(this[Ru]&&this[Ru].car){u=this[Ru].car}else{u=Zi(this.car,e,true)}if(u!==undefined){i.push(u)}if(this.cdr instanceof Ni){if(this[Ru]&&this[Ru].cdr){i.push(" . ");i.push(this[Ru].cdr)}else{if(this.cdr[Nu]){i.push(" . ")}else{i.push(" ")}var a=this.cdr.toString(e,{nested:true});i.push(a)}}else if(this.cdr!==Pi){i=i.concat([" . ",Zi(this.cdr,e,true)])}if(!n||this[Nu]){i.push(")")}return i.join("")};Ni.prototype.set=function(e,t){this[e]=t;if(t instanceof Ni){this.markCycles()}};Ni.prototype.append=function(e){if(e instanceof Array){return this.append(Ni.fromArray(e))}var t=this;if(t.car===undefined){if(e instanceof Ni){this.car=e.car;this.cdr=e.cdr}else{this.car=e}}else if(e!==Pi){while(true){if(t instanceof Ni&&t.cdr!==Pi){t=t.cdr}else{break}}t.cdr=e}return this};Ni.prototype.serialize=function(){return[this.car,this.cdr]};Ni.prototype[Symbol.iterator]=function(){var r=this;return{next:function e(){var t=r;r=t.cdr;if(t===Pi){return{value:undefined,done:true}}else{return{value:t.car,done:false}}}}};function eu(e){return e<0?-e:e}function tu(e,t){var r=h(t),n=r[0],i=r.slice(1);while(i.length>0){var u=i,a=A(u,1),o=a[0];if(!e(n,o)){return false}var s=i;var c=h(s);n=c[0];i=c.slice(1)}return true}function ru(e,t){if(vu(e)){return vu(t)&&Fu(e)===Fu(t)}else if(e instanceof da){if(!(t instanceof da)){return false}var r;if(e.__type__===t.__type__){if(e.__type__==="complex"){r=e.__im__.__type__===t.__im__.__type__&&e.__re__.__type__===t.__re__.__type__}else{r=true}if(r&&e.cmp(t)===0){if(e.valueOf()===0){return Object.is(e.valueOf(),t.valueOf())}return true}}return false}else if(typeof e==="number"){if(typeof t!=="number"){return false}if(Number.isNaN(e)){return Number.isNaN(t)}if(e===Number.NEGATIVE_INFINITY){return t===Number.NEGATIVE_INFINITY}if(e===Number.POSITIVE_INFINITY){return t===Number.POSITIVE_INFINITY}return ru(da(e),da(t))}else if(e instanceof oa){if(!(t instanceof oa)){return false}return e.__char__===t.__char__}else{return e===t}}function nu(e,t){if(Ao(e)!==Ao(t)){return false}if(!iu(e)){return false}if(e instanceof RegExp){return e.source===t.source}if(e instanceof sa){return e.valueOf()===t.valueOf()}return ru(e,t)}function iu(e){return e instanceof Ln||sa.isString(e)||e===Pi||e===null||e instanceof oa||e instanceof da||e===true||e===false}var uu=function(){if(Math.trunc){return Math.trunc}else{return function(e){if(e===0){return 0}else if(e<0){return Math.ceil(e)}else{return Math.floor(e)}}}}();function au(e,t,r,n){if(typeof this!=="undefined"&&this.constructor!==au||typeof this==="undefined"){return new au(e,t)}yo("Macro",e,"string",1);yo("Macro",t,"function",2);if(r){if(n){this.__doc__=r}else{this.__doc__=fi(r)}}this.__name__=e;this.__fn__=t}au.defmacro=function(e,t,r,n){var i=new au(e,t,r,n);i.__defmacro__=true;return i};au.prototype.invoke=function(e,t,r){var n=t.env,i=t.dynamic_scope,u=t.error;var a={dynamic_scope:i,error:u,macro_expand:r};var o=this.__fn__.call(n,e,a,this.__name__);return o};au.prototype.toString=function(){return"#")};var ou="define-macro";var su=-1e4;function cu(c){return function(){var r=O(j.mark(function e(r,y){var u,g,n,i,a,b,w,D,E,A,F,x,o,C,s;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:s=function e(){s=O(j.mark(function e(r,n,i){var u,a,o,s,c,f,l,h,p,_,d,v,m;return j.wrap(function e(t){while(1){switch(t.prev=t.next){case 0:if(!(r instanceof Ni&&r.car instanceof Ln)){t.next=50;break}if(!r[Pu]){t.next=3;break}return t.abrupt("return",r);case 3:u=r.car.valueOf();a=i.get(r.car,{throwError:false});o=b(r.car);s=o||w(a,r)||D(a);if(!(s&&r.cdr.car instanceof Ni)){t.next=28;break}if(!o){t.next=15;break}g=A(r.cdr.car);t.next=12;return x(r.cdr.car,n);case 12:c=t.sent;t.next=17;break;case 15:g=E(r.cdr.car);c=r.cdr.car;case 17:t.t0=Ni;t.t1=r.car;t.t2=Ni;t.t3=c;t.next=23;return C(r.cdr.cdr,n,i);case 23:t.t4=t.sent;t.t5=new t.t2(t.t3,t.t4);return t.abrupt("return",new t.t0(t.t1,t.t5));case 28:if(!F(u,a)){t.next=50;break}f=a instanceof fu?r:r.cdr;t.next=32;return a.invoke(f,Br(Br({},y),{},{env:i}),true);case 32:l=t.sent;if(!(a instanceof fu)){t.next=41;break}h=l,p=h.expr,_=h.scope;if(!(p instanceof Ni)){t.next=40;break}if(!(n!==-1&&n<=1||n")}return"#"};fu.className="syntax";var lu=function(e){u(r,e);var t=Fr(r);function r(){y(this,r);return t.apply(this,arguments)}return r}(fu);fu.Parameter=lu;function hu(e,t,w,D){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};var E={"...":{symbols:{},lists:[]},symbols:{}};var A=r.expansion,F=r.define;function x(e){if(Mr()){console.log(e)}}x(w);function C(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;x({code:t&&Zi(t,true),pattern:e&&Zi(e,true)});if(iu(e)&&!(e instanceof Ln)){return nu(e,t)}if(e instanceof Ln&&w.includes(e.literal())){var i=A.ref(t);if(Ln.is(t,e)){if(typeof i==="undefined"){return true}return i===F||i===io}return false}if(e instanceof Ni&&e.car instanceof Ni&&e.car.cdr instanceof Ni&&Ln.is(e.car.cdr.car,D)){x(">> 0");if(t===Pi){x({pattern:e.toString()});if(e.car.car instanceof Ln){if(e.car.cdr instanceof Ni&&Ln.is(e.car.cdr.car,D)){var u=e.car.car.valueOf();var a=e.last_pair();if(Ln.is(a.car,D)){E["..."].symbols[u]=null;return true}else{return false}}var o=e.car.car.valueOf();if(E["..."].symbols[o]){throw new Error("syntax: named ellipsis can only "+"appear onces")}E["..."].symbols[o]=t}}}if(e instanceof Ni&&e.cdr instanceof Ni&&Ln.is(e.cdr.car,D)){if(e.cdr.cdr!==Pi){if(e.cdr.cdr instanceof Ni){var s=e.cdr.cdr.length();var c=t.length();var f=t;while(c-1>s){f=f.cdr;c--}var l=f.cdr;f.cdr=Pi;if(!C(e.cdr.cdr,l,r,n)){return false}}}if(e.car instanceof Ln){var h=e.car.__name__;if(E["..."].symbols[h]&&!r.includes(h)&&!n){throw new Error("syntax: named ellipsis can only appear onces")}x(">> 1");if(t===Pi){x(">> 2");if(n){x("NIL");E["..."].symbols[h]=Pi}else{x("NULL");E["..."].symbols[h]=null}}else if(t instanceof Ni&&(t.car instanceof Ni||t.car===Pi)){x(">> 3 "+n);if(n){if(E["..."].symbols[h]){var p=E["..."].symbols[h];if(p===Pi){p=new Ni(Pi,new Ni(t,Pi))}else{p=p.append(new Ni(t,Pi))}E["..."].symbols[h]=p}else{E["..."].symbols[h]=new Ni(t,Pi)}}else{x(">> 4");E["..."].symbols[h]=new Ni(t,Pi)}}else{x(">> 6");if(t instanceof Ni){x(">> 7 "+n);r.push(h);if(!E["..."].symbols[h]){E["..."].symbols[h]=new Ni(t,Pi)}else{var _=E["..."].symbols[h];E["..."].symbols[h]=_.append(new Ni(t,Pi))}x({IIIIII:E["..."].symbols[h].toString()})}else{x(">> 8");return false}}return true}else if(e.car instanceof Ni){var d=k(r);if(t===Pi){x(">> 9");E["..."].lists.push(Pi);return true}x(">> 10");var v=t;while(v instanceof Ni){if(!C(e.car,v.car,d,true)){return false}v=v.cdr}return true}return false}if(e instanceof Ln){if(Ln.is(e,D)){throw new Error("syntax: invalid usage of ellipsis")}x(">> 11");var m=e.__name__;if(w.includes(m)){return true}x({name:m,ellipsis:n});if(n){E["..."].symbols[m]=E["..."].symbols[m]||[];E["..."].symbols[m].push(t)}E.symbols[m]=t;if(!E.symbols[m]);return true}if(e instanceof Ni&&t instanceof Ni){x(">> 12");x({a:12,code:t&&t.toString(),pattern:e.toString()});if(t.cdr===Pi){var y=e.car instanceof Ln&&e.cdr instanceof Ln;if(y){if(!C(e.car,t.car,r,n)){return false}x(">> 12 | 1");var g=e.cdr.valueOf();if(!(g in E.symbols)){E.symbols[g]=Pi}g=e.car.valueOf();if(!(g in E.symbols)){E.symbols[g]=t.car}return true}}x({pattern:e.toString(),code:t.toString()});if(e.cdr instanceof Ni&&e.car instanceof Ln&&e.cdr.cdr instanceof Ni&&e.cdr.car instanceof Ln&&Ln.is(e.cdr.cdr.car,D)&&e.cdr.cdr.cdr instanceof Ni&&!Ln.is(e.cdr.cdr.cdr.car,D)&&C(e.car,t.car,r,n)&&C(e.cdr.cdr.cdr,t.cdr,r,n)){var b=e.cdr.car.__name__;x({pattern:e.car.toString(),code:t.car.toString(),name:b});if(w.includes(b)){return true}E["..."].symbols[b]=null;return true}x("recur");if(C(e.car,t.car,r,n)&&C(e.cdr,t.cdr,r,n)){return true}}else if(e===Pi&&(t===Pi||t===undefined)){return true}else if(e.car instanceof Ni&&Ln.is(e.car.car,D)){throw new Error("syntax: invalid usage of ellipsis")}else{return false}}if(C(e,t)){return E}}function pu(e,i){function u(t){if(t instanceof Ni){if(!i.length){return t}var e=u(t.car);var r=u(t.cdr);return new Ni(e,r)}else if(t instanceof Ln){var n=i.find(function(e){return e.gensym===t});if(n){return Ln(n.name)}return t}else{return t}}return u(e)}function _u(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var O=e.bindings,t=e.expr,S=e.scope,a=e.symbols,c=e.names,B=e.ellipsis;var f={};function o(e){if(e instanceof Ln){return true}return["string","symbol"].includes(_(e))}function j(e){if(!o(e)){var t=Ao(e);throw new Error("syntax: internal error, need symbol got ".concat(t))}var r=e.valueOf();if(r===B){throw new Error("syntax: internal error, ellipis not transformed")}var n=_(r);if(["string","symbol"].includes(n)){if(r in O.symbols){return O.symbols[r]}else if(n==="string"&&r.match(/\./)){var i=r.split(".");var u=i[0];if(u in O.symbols){return Ni.fromArray([Ln("."),O.symbols[u]].concat(i.slice(1).map(function(e){return sa(e)})))}}}if(a.includes(r)){return Ln(r)}return s(r)}function I(e){if(Mr()){console.log(e)}}function s(e){if(!f[e]){var t=S.ref(e);var r=Mn(e);if(t){var n=S.get(e);S.set(r,n)}else{var i=S.get(e,{throwError:false});if(typeof i!=="undefined"){S.set(r,i)}}c.push({name:e,gensym:r});f[e]=r;if(typeof e==="string"&&e.match(/\./)){var u=e.split(".").filter(Boolean),a=h(u),o=a[0],s=a.slice(1);if(f[o]){$u(r,"__object__",[f[o]].concat(k(s)))}}}return f[e]}function P(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(){};var i=r.nested;I(" ==> "+e.toString(true));I(t);if(e instanceof Ln){var u=e.valueOf();I("[t 1");if(t[u]){if(t[u]instanceof Ni){var a=t[u],o=a.car,s=a.cdr;if(i){var c=o.car,f=o.cdr;if(f!==Pi){n(u,new Ni(f,Pi))}return c}if(s!==Pi){n(u,s)}return o}else if(t[u]instanceof Array){n(u,t[u].slice(1));return t[u][0]}}return j(u)}if(e instanceof Ni){if(e.car instanceof Ln&&e.cdr instanceof Ni&&Ln.is(e.cdr.car,B)){I("[t 2");var l=e.car.valueOf();var h=t[l];I({expr:e.toString(true),name:l,bindings:t,item:h});if(h===null){return}else if(h){I({b:t[l].toString()});if(h instanceof Ni){I("[t 2 Pair "+i);I({______:h.toString()});var p=h.car,_=h.cdr;if(i){if(_!==Pi){I("|| next 1");n(l,_)}I({car:p.toString()});return p}else{if(p.cdr!==Pi){I("|| next 2");n(l,new Ni(p.cdr,_))}I({car:p.car.toString()});return p.car}}else if(h instanceof Array){I("[t 2 Array "+i);if(i){n(l,h.slice(1));return Ni.fromArray(h)}else{var d=h.slice(1);if(d.length){n(l,d)}return h[0]}}else{return h}}}I("[t 3 recur "+e.toString());var v=P(e.car,t,r,n);var m=P(e.cdr,t,r,n);return new Ni(v,m)}return e}function N(t,r){var e=Object.values(t);var n=Object.getOwnPropertySymbols(t);if(n.length){e.push.apply(e,k(n.map(function(e){return t[e]})))}return e.length&&e.every(function(e){if(e===null){return!r}return e instanceof Ni||e===Pi||e instanceof Array&&e.length})}function R(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function T(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},t=e.disabled;I("traverse>> "+i.toString());if(i instanceof Ni){if(!t&&i.car instanceof Ni&&Ln.is(i.car.car,B)){return T(i.car.cdr,{disabled:true})}if(i.cdr instanceof Ni&&Ln.is(i.cdr.car,B)&&!t){I(">> 1");var r=O["..."].symbols;var n=Object.values(r);if(n.length&&n.every(function(e){return e===null})){return T(i.cdr.cdr,{disabled:t})}var u=R(r);var a=i.car instanceof Ln&&Ln.is(i.cdr.cdr.car,B);if(i.car instanceof Ni||a){if(O["..."].lists[0]===Pi){return Pi}var o=i.car;if(a){o=new Ni(i.car,new Ni(i.cdr.car,Pi))}I(">> 2");var s;if(u.length){I(">> 2 (a)");var c=Br({},r);s=Pi;var f=function e(){if(!N(c)){return"break"}var n={};var t=function e(t,r){n[t]=r};var r=P(o,c,{nested:true},t);if(r!==undefined){if(a){if(s===Pi){s=r}else{s=s.append(r)}}else{s=new Ni(r,s)}}c=n};while(true){var l=f();if(l==="break")break}if(s!==Pi&&!a){s=s.reverse()}if(i.cdr.cdr!==Pi&&!Ln.is(i.cdr.cdr.car,B)){var h=T(i.cdr.cdr,{disabled:t});return s.append(h)}return s}else{I(">> 3");var p=P(i.car,r,{nested:true});if(p){return new Ni(p,Pi)}return Pi}}else if(i.car instanceof Ln){I(">> 4");if(Ln.is(i.cdr.cdr.car,B)){I(">> 4 (a)")}else{I(">> 4 (b)")}var _=i.car.__name__;var d=L({},_,r[_]);var v=r[_]===null;var m=Pi;var y=function e(){if(!N(d,true)){I({bind:d});return"break"}var n={};var t=function e(t,r){n[t]=r};var r=P(i,d,{nested:false},t);I({value:r.toString()});if(typeof r!=="undefined"){m=new Ni(r,m)}d=n};while(true){var g=y();if(g==="break")break}if(m!==Pi){m=m.reverse()}if(i.cdr instanceof Ni){if(i.cdr.cdr instanceof Ni||i.cdr.cdr instanceof Ln){var b=T(i.cdr.cdr,{disabled:t});if(v){return b}I("<<<< 1");m.append(b)}}I("<<<< 2");return m}}var w=T(i.car,{disabled:t});var D;var E;if(i.car instanceof Ln){var A=S.get(i.car,{throwError:false});E=A instanceof au&&A.__name__==="syntax-rules"}if(E){if(i.cdr.car instanceof Ln){D=new Ni(T(i.cdr.car,{disabled:t}),new Ni(i.cdr.cdr.car,T(i.cdr.cdr.cdr,{disabled:t})))}else{D=new Ni(i.cdr.car,T(i.cdr.cdr,{disabled:t}))}I("REST >>>> "+D.toString())}else{D=T(i.cdr,{disabled:t})}I({a:true,car:Zi(i.car),cdr:Zi(i.cdr),head:Zi(w),rest:Zi(D)});return new Ni(w,D)}if(i instanceof Ln){if(t&&Ln.is(i,B)){return i}var F=Object.keys(O["..."].symbols);var x=i.literal();if(F.includes(x)){var C="missing ellipsis symbol next to name `".concat(x,"'");throw new Error("syntax-rules: ".concat(C))}var k=j(i);if(typeof k!=="undefined"){return k}}return i}return T(t,{})}function du(e){return bu(e)||e===Pi||e===null}function vu(e){return typeof e==="function"&&typeof e.bind==="function"}function mu(e){return e instanceof Bo}function yu(e){return vu(e)||mu(e)}function gu(e){if(e instanceof Yn){return false}if(e instanceof Promise){return true}return e&&vu(e.then)}function bu(e){return typeof e==="undefined"}function wu(e){switch(_(e)){case"string":return sa(e);case"bigint":return da(e);case"number":if(Number.isNaN(e)){return ro}else{return da(e)}}return e}function Du(n,i){var e=Object.getOwnPropertyNames(n);var t=Object.getOwnPropertySymbols(n);e.concat(t).forEach(function(e){var t=i(n[e]);var r=Object.getOwnPropertyDescriptor(n,e);if(!r||r.writable&&n[e]!==t){n[e]=t}});return n}function Eu(t){var e=[sa,oa,da].some(function(e){return t instanceof e});if(e){return t.valueOf()}if(t instanceof Array){return t.map(Eu)}if(t instanceof Yn){delete t.then}if(Li(t)){return Du(t,Eu)}return t}function Au(e,t){if(e instanceof Ni){e.markCycles();return Qa(e)}if(vu(e)){if(t){return xu(e,t)}}return wu(e)}function Fu(e){if(ku(e)){return e[Iu]}return e}function xu(e,t){if(e[Symbol["for"]("__bound__")]){return e}var r=e.bind(t);var n=Object.getOwnPropertyNames(e);var i=Cr(n),u;try{for(i.s();!(u=i.n()).done;){var a=u.value;if(Yu(a)){try{r[a]=e[a]}catch(e){}}}}catch(e){i.e(e)}finally{i.f()}$u(r,"__fn__",e);$u(r,"__context__",t);$u(r,"__bound__",true);if(Hu(e)){$u(r,"__native__",true)}if(Li(t)&&Vu(e)){$u(r,"__method__",true)}r.valueOf=function(){return e};return r}function Cu(e){return ku(e)&&e[Symbol["for"]("__context__")]===Object}function ku(e){return!!(vu(e)&&e[Iu])}function Ou(e){if(vu(e)){var t=e[ju];if(t&&(t===ps||t.constructor&&t.constructor.__class__)){return true}}return false}function Su(e){return e instanceof Sa||e instanceof Ba}function Bu(e){if(vu(e)){if(Su(e[ju])){return true}}return false}var ju=Symbol["for"]("__context__");var Iu=Symbol["for"]("__fn__");var Pu=Symbol["for"]("__data__");var Nu=Symbol["for"]("__ref__");var Ru=Symbol["for"]("__cycles__");var Tu=Symbol["for"]("__class__");var Lu=Symbol["for"]("__method__");var Uu=Symbol["for"]("__prototype__");var qu=Symbol["for"]("__lambda__");var Mu=["name","length","caller","callee","arguments","prototype"];function Yu(e){return!Mu.includes(e)}function $u(e,t,r){Object.defineProperty(e,Symbol["for"](t),{get:function e(){return r},set:function e(){},configurable:false,enumerable:false})}function zu(t,r){try{Object.defineProperty(t,"length",{get:function e(){return r}});return t}catch(e){var n=new Array(r).fill(0).map(function(e,t){return"a"+t}).join(",");var i=new Function("f","return function(".concat(n,") {\n return f.apply(this, arguments);\n };"));return i(t)}}function Vu(e){return e&&e[qu]}function Ju(e){return e&&e[Lu]}function Gu(e){return Vu(e)&&!e[Uu]&&!Ju(e)&&!Bu(e)}function Hu(e){var t=Symbol["for"]("__native__");return vu(e)&&e.toString().match(/\{\s*\[native code\]\s*\}/)&&(e.name.match(/^bound /)&&e[t]===true||!e.name.match(/^bound /)&&!e[t])}function Wu(e){var g;switch(e){case Symbol["for"]("letrec"):g="letrec";break;case Symbol["for"]("let"):g="let";break;case Symbol["for"]("let*"):g="let*";break;default:throw new Error("Invalid let_macro value")}return au.defmacro(g,function(t,e){var f=e.dynamic_scope,l=e.error,r=e.macro_expand;var h;if(t.car instanceof Ln){if(!(t.cdr.car instanceof Ni||t.cdr.car===Pi)){throw new Error("let require list of pairs")}var n;if(t.cdr.car===Pi){h=Pi;n=Pi}else{n=t.cdr.car.map(function(e){return e.car});h=t.cdr.car.map(function(e){return e.cdr.car})}return Ni.fromArray([Ln("letrec"),[[t.car,Ni(Ln("lambda"),Ni(n,t.cdr.cdr))]],Ni(t.car,h)])}else if(r){return}var p=this;h=io.get("list->array")(t.car);var _=p.inherit(g);var d,v;if(g==="let*"){v=_}else if(g==="let"){d=[]}var m=0;function y(){var e=new Ni(new Ln("begin"),t.cdr);return Io(e,{env:_,dynamic_scope:f,error:l})}return function t(){var r=h[m++];if(f){f=g==="let*"?_:p}if(!r){if(d&&d.length){var e=d.map(function(e){return e.value});var n=e.filter(gu);if(n.length){return $n(e).then(function(e){for(var t=0,r=e.length;t